diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-15 06:14:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-15 06:14:42 +0000 |
commit | 9a9a4e874d2257fcdb6fba0be5fa6fb3c402076d (patch) | |
tree | c0e3285b046c8971a40259c8e4ad93084b4dfcd1 /benchmark | |
parent | 0efd8bbd34117437f0e1584fe1c1f2177ed09d0d (diff) | |
download | ruby-9a9a4e874d2257fcdb6fba0be5fa6fb3c402076d.tar.gz |
Benchmarks for Array#values_at
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/bm_array_values_at_int.rb | 2 | ||||
-rw-r--r-- | benchmark/bm_array_values_at_range.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/benchmark/bm_array_values_at_int.rb b/benchmark/bm_array_values_at_int.rb new file mode 100644 index 0000000000..6cb394cb9f --- /dev/null +++ b/benchmark/bm_array_values_at_int.rb @@ -0,0 +1,2 @@ +ary = Array.new(10000) {|i| i} +100000.times { ary.values_at(500) } diff --git a/benchmark/bm_array_values_at_range.rb b/benchmark/bm_array_values_at_range.rb new file mode 100644 index 0000000000..5b53806d1c --- /dev/null +++ b/benchmark/bm_array_values_at_range.rb @@ -0,0 +1,2 @@ +ary = Array.new(10000) {|i| i} +100000.times { ary.values_at(1..2000) } |