aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark
diff options
context:
space:
mode:
authorKouhei Yanagita <yanagi@shakenbu.org>2023-09-28 13:10:42 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-12 17:34:49 +0900
commit769f53eb7e9db306988bb99802b15942c1c755c3 (patch)
treef08aaa4233923dffeaffb2916dc42d379faa57e5 /benchmark
parent66fabefa0312859f5bbd7c95d745b677e44b20be (diff)
downloadruby-769f53eb7e9db306988bb99802b15942c1c755c3.tar.gz
Add benchmarks for Range#reverse_each
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/range_reverse_each.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/benchmark/range_reverse_each.yml b/benchmark/range_reverse_each.yml
new file mode 100644
index 0000000000..a32efeccc6
--- /dev/null
+++ b/benchmark/range_reverse_each.yml
@@ -0,0 +1,16 @@
+prelude: |
+ rf_1 = 0..1
+ rf_1k = 0..1000
+ rf_1m = 0..1000000
+ big = 2**1000
+ rb_1 = big..big+1
+ rb_1k = big..big+1000
+ rb_1m = big..big+1000000
+
+benchmark:
+ "Fixnum 1": rf_1.reverse_each { _1 }
+ "Fixnum 1K": rf_1k.reverse_each { _1 }
+ "Fixnum 1M": rf_1m.reverse_each { _1 }
+ "Bignum 1": rb_1.reverse_each { _1 }
+ "Bignum 1K": rb_1k.reverse_each { _1 }
+ "Bignum 1M": rb_1m.reverse_each { _1 }