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

Function BenchmarkPatchFromText

diffmatchpatch/patch_test.go:394–405  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

392}
393
394func BenchmarkPatchFromText(b *testing.B) {
395 s1, s2 := speedtestTexts()
396
397 dmp := New()
398 text := dmp.PatchToText(dmp.PatchMake(s1, s2))
399
400 b.ResetTimer()
401
402 for i := 0; i < b.N; i++ {
403 _, _ = dmp.PatchFromText(text)
404 }
405}
406
407func BenchmarkPatchApply(b *testing.B) {
408 s1, s2 := speedtestTexts()

Callers

nothing calls this directly

Calls 5

speedtestTextsFunction · 0.85
NewFunction · 0.85
PatchToTextMethod · 0.80
PatchMakeMethod · 0.80
PatchFromTextMethod · 0.80

Tested by

no test coverage detected