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

Function BenchmarkDiffMainRunesLargeDiffLines

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

Source from the content-addressed store, hash-verified

1559}
1560
1561func BenchmarkDiffMainRunesLargeDiffLines(b *testing.B) {
1562 fp, _ := os.Open("../testdata/diff10klinestest.txt")
1563 defer fp.Close()
1564 data, _ := ioutil.ReadAll(fp)
1565
1566 dmp := New()
1567
1568 b.ResetTimer()
1569
1570 for i := 0; i < b.N; i++ {
1571 text1, text2, linearray := dmp.DiffLinesToRunes(string(data), "")
1572
1573 diffs := dmp.DiffMainRunes(text1, text2, false)
1574 diffs = dmp.DiffCharsToLines(diffs, linearray)
1575 }
1576}

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…