MCPcopy
hub / github.com/grafana/tempo / NewResultPool

Function NewResultPool

pkg/parquetquery/pool.go:19–24  ·  view source on GitHub ↗

NewResultPool creates a pool for reusing IteratorResults. New items are created with the given default capacity. Using different pools is helpful to keep items of similar sizes together which reduces slice allocations.

(defaultCapacity int)

Source from the content-addressed store, hash-verified

17// with the given default capacity. Using different pools is helpful to keep
18// items of similar sizes together which reduces slice allocations.
19func NewResultPool(defaultCapacity int) *ResultPool {
20 return &ResultPool{
21 pool: &sync.Pool{},
22 cap: defaultCapacity,
23 }
24}
25
26func (p *ResultPool) Get() *IteratorResult {
27 if x := p.pool.Get(); x != nil {

Callers 5

block_traceql.goFile · 0.92
block_traceql.goFile · 0.92
block_traceql.goFile · 0.92
pool.goFile · 0.85
TestResultPoolReleaseFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestResultPoolReleaseFunction · 0.68