• Rui Ueyama's avatar
    strings: use Rabin-Karp algorithm for LastIndex. · 55337807
    Rui Ueyama authored
    benchmark                  old ns/op     new ns/op     delta
    BenchmarkSingleMatch       49443         52275         +5.73%
    BenchmarkIndex             28.8          27.4          -4.86%
    BenchmarkLastIndex         14.5          14.0          -3.45%
    BenchmarkLastIndexHard1    3982782       2309200       -42.02%
    BenchmarkLastIndexHard2    3985562       2287715       -42.60%
    BenchmarkLastIndexHard3    3555259       2282866       -35.79%
    
    LGTM=josharian, nigeltao
    R=golang-codereviews, ality, josharian, bradfitz, dave, nigeltao, gobot, nightlyone
    CC=golang-codereviews
    https://golang.org/cl/102560043
    55337807
Name
Last commit
Last update
..
example_test.go Loading commit data...
export_test.go Loading commit data...
reader.go Loading commit data...
reader_test.go Loading commit data...
replace.go Loading commit data...
replace_test.go Loading commit data...
search.go Loading commit data...
search_test.go Loading commit data...
strings.go Loading commit data...
strings.s Loading commit data...
strings_decl.go Loading commit data...
strings_test.go Loading commit data...