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

Function BenchmarkDiffMainRunesLargeDiffLines

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

Source from the content-addressed store, hash-verified

1587}
1588
1589func BenchmarkDiffMainRunesLargeDiffLines(b *testing.B) {
1590 fp, _ := os.Open("../testdata/diff10klinestest.txt")
1591 defer fp.Close()
1592 data, _ := ioutil.ReadAll(fp)
1593
1594 dmp := New()
1595
1596 b.ResetTimer()
1597
1598 for i := 0; i < b.N; i++ {
1599 text1, text2, linearray := dmp.DiffLinesToRunes(string(data), "")
1600
1601 diffs := dmp.DiffMainRunes(text1, text2, false)
1602 diffs = dmp.DiffCharsToLines(diffs, linearray)
1603 }
1604}

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected