ruby/benchmark/string_index.rb

4 строки
106 B
Ruby

str1 = "" * 1024 + "" # not single byte optimizable
str2 = ""
100_000.times { str1.index(str2) }