MCPcopy Create free account
hub / github.com/micro-editor/micro / benchCreateAndClose

Function benchCreateAndClose

internal/buffer/buffer_test.go:119–130  ·  view source on GitHub ↗
(testingB *testing.B, nLines int)

Source from the content-addressed store, hash-verified

117}
118
119func benchCreateAndClose(testingB *testing.B, nLines int) {
120 rand.Seed(int64(nLines))
121
122 text := randomText(nLines)
123
124 testingB.ResetTimer()
125
126 for i := 0; i < testingB.N; i++ {
127 b := NewBufferFromString(text, "", BTDefault)
128 b.Close()
129 }
130}
131
132func benchRead(testingB *testing.B, nLines int) {
133 rand.Seed(int64(nLines))

Calls 3

randomTextFunction · 0.85
NewBufferFromStringFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected