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') }