MCPcopy Create free account
hub / github.com/cogentcore/core / BenchmarkDiffer

Function BenchmarkDiffer

texteditor/difflib/bytes/bytes_test.go:493–506  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

491}
492
493func BenchmarkDiffer(b *testing.B) {
494 A, B := prepareFilesToDiff(b.N, 0)
495 fmt.Printf("\nDiff length:")
496 b.ResetTimer()
497 differ := NewDiffer()
498 for i := range A {
499 var x [][]byte
500 for n := 0; n < 5; n++ {
501 x, _ = differ.Compare(A[i], B[i])
502 }
503 fmt.Printf(" %v", len(x))
504 }
505 fmt.Printf("\n")
506}
507
508func BenchmarkMatcher(b *testing.B) {
509 As, Bs := prepareFilesToDiff(b.N, 0)

Callers

nothing calls this directly

Calls 4

CompareMethod · 0.95
prepareFilesToDiffFunction · 0.70
NewDifferFunction · 0.70
PrintfMethod · 0.45

Tested by

no test coverage detected