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

Function BenchmarkDiffCommonSuffix

diffmatchpatch/diff_test.go:137–147  ·  view source on GitHub ↗

exported sink var to avoid compiler optimizations in benchmarks

(b *testing.B)

Source from the content-addressed store, hash-verified

135var SinkInt int // exported sink var to avoid compiler optimizations in benchmarks
136
137func BenchmarkDiffCommonSuffix(b *testing.B) {
138 s := "ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ"
139
140 dmp := New()
141
142 b.ResetTimer()
143
144 for i := 0; i < b.N; i++ {
145 SinkInt = dmp.DiffCommonSuffix(s, s)
146 }
147}
148
149func BenchmarkCommonLength(b *testing.B) {
150 data := []struct {

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
DiffCommonSuffixMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…