aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-22 22:49:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-22 22:49:48 +0900
commit8390057d1ee9acd67ac9f36dee59f500b1f1bc5f (patch)
tree78e00beb10a9459d91e5b7a3e1732f9444f00830 /benchmark
parent99ca5705a24d540b95fb7069707514c1510f1a81 (diff)
downloadruby-8390057d1ee9acd67ac9f36dee59f500b1f1bc5f.tar.gz
Benchmark for [Feature #16155]
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/array_intersection.yml14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmark/array_intersection.yml b/benchmark/array_intersection.yml
new file mode 100644
index 0000000000..26705323fd
--- /dev/null
+++ b/benchmark/array_intersection.yml
@@ -0,0 +1,14 @@
+prelude: |
+ small1 = [1, 2, 3]
+ small2 = [1, 2, 3, 4, 5]
+ small3 = [2, 3, 4, 5]
+ small4 = [2]
+ big1 = [1, 2, 3, 4] * 64
+ big2 = [1, 2, 3] * 64
+ big3 = [1, 2] * 64
+
+benchmark:
+ small-&: small1 & small2 & small3 & small4
+ small-intersection: small1.intersection(small2, small3, small4)
+ big-&: big1 & big2 & big3
+ big-intersection: big1.intersection(big2, big3)