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

Function benchmarkSplitLines

texteditor/difflib/bytes/bytes_test.go:459–468  ·  view source on GitHub ↗
(b *testing.B, count int)

Source from the content-addressed store, hash-verified

457}
458
459func benchmarkSplitLines(b *testing.B, count int) {
460 str := bytes.Repeat([]byte("foo\n"), count)
461
462 b.ResetTimer()
463
464 n := 0
465 for i := 0; i < b.N; i++ {
466 n += len(SplitLines(str))
467 }
468}
469
470func BenchmarkSplitLines100(b *testing.B) {
471 benchmarkSplitLines(b, 100)

Callers 2

BenchmarkSplitLines100Function · 0.70
BenchmarkSplitLines10000Function · 0.70

Calls 1

SplitLinesFunction · 0.70

Tested by

no test coverage detected