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

Function BenchmarkDiffMainRunesLargeLines

diffmatchpatch/diff_test.go:1574–1587  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1572}
1573
1574func BenchmarkDiffMainRunesLargeLines(b *testing.B) {
1575 s1, s2 := speedtestTexts()
1576
1577 dmp := New()
1578
1579 b.ResetTimer()
1580
1581 for i := 0; i < b.N; i++ {
1582 text1, text2, linearray := dmp.DiffLinesToRunes(s1, s2)
1583
1584 diffs := dmp.DiffMainRunes(text1, text2, false)
1585 diffs = dmp.DiffCharsToLines(diffs, linearray)
1586 }
1587}
1588
1589func BenchmarkDiffMainRunesLargeDiffLines(b *testing.B) {
1590 fp, _ := os.Open("../testdata/diff10klinestest.txt")

Callers

nothing calls this directly

Calls 5

speedtestTextsFunction · 0.85
NewFunction · 0.85
DiffLinesToRunesMethod · 0.80
DiffMainRunesMethod · 0.80
DiffCharsToLinesMethod · 0.80

Tested by

no test coverage detected