MCPcopy Create free account
hub / github.com/sergi/go-diff / BenchmarkMatchBitap

Function BenchmarkMatchBitap

diffmatchpatch/match_test.go:176–188  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

174}
175
176func BenchmarkMatchBitap(b *testing.B) {
177 s1, _ := speedtestTexts()
178 // A pattern near MatchMaxBits with a few typos, searched far from its real location.
179 pattern := "Twas brilig, and the slithy tove"
180
181 dmp := New()
182
183 b.ResetTimer()
184
185 for i := 0; i < b.N; i++ {
186 dmp.MatchBitap(s1, pattern, len(s1)/2)
187 }
188}

Callers

nothing calls this directly

Calls 3

speedtestTextsFunction · 0.85
NewFunction · 0.85
MatchBitapMethod · 0.80

Tested by

no test coverage detected