aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-04 04:25:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-04 04:25:12 +0000
commitc06df0925c4a282afe5135b4e3b4e0063e27a24b (patch)
tree8a0ec3e51f84c2617ab8043c4e5f5b2b5f1cb2b4 /benchmark
parent2c3ac11cca566a0d2cecdcd049768b02783053fc (diff)
downloadruby-c06df0925c4a282afe5135b4e3b4e0063e27a24b.tar.gz
benchmarks for String#scan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_string_scan_re.rb2
-rw-r--r--benchmark/bm_string_scan_str.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/benchmark/bm_string_scan_re.rb b/benchmark/bm_string_scan_re.rb
new file mode 100644
index 0000000000..b0d60201a9
--- /dev/null
+++ b/benchmark/bm_string_scan_re.rb
@@ -0,0 +1,2 @@
+str = Array.new(1_000, 'abc').join(',')
+1_000.times { str.scan(/abc/) }
diff --git a/benchmark/bm_string_scan_str.rb b/benchmark/bm_string_scan_str.rb
new file mode 100644
index 0000000000..42440bd948
--- /dev/null
+++ b/benchmark/bm_string_scan_str.rb
@@ -0,0 +1,2 @@
+str = Array.new(1_000, 'abc').join(',')
+1_000.times { str.scan('abc') }