From 9a9a4e874d2257fcdb6fba0be5fa6fb3c402076d Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 15 Feb 2018 06:14:42 +0000 Subject: [PATCH] Benchmarks for Array#values_at git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/bm_array_values_at_int.rb | 2 ++ benchmark/bm_array_values_at_range.rb | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 benchmark/bm_array_values_at_int.rb create mode 100644 benchmark/bm_array_values_at_range.rb 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) }