MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TestNewBufferPool

Function TestNewBufferPool

internal/utils/buffer_pool_test.go:12–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestNewBufferPool(t *testing.T) {
13 var pool = utils.NewBufferPool()
14 var b = pool.Get()
15 b.WriteString("Hello, World")
16 t.Log(b.String())
17
18 pool.Put(b)
19 t.Log(b.String())
20
21 b = pool.Get()
22 t.Log(b.String())
23}
24
25func BenchmarkNewBufferPool1(b *testing.B) {
26 var data = []byte(strings.Repeat("Hello", 1024))

Callers

nothing calls this directly

Calls 6

NewBufferPoolFunction · 0.92
WriteStringMethod · 0.80
LogMethod · 0.80
GetMethod · 0.45
StringMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected