MCPcopy
hub / github.com/redis/go-redis / BenchmarkPoolHighContention

Function BenchmarkPoolHighContention

pool_pubsub_bench_test.go:363–378  ·  view source on GitHub ↗

BenchmarkPoolHighContention tests pool performance under high contention

(b *testing.B)

Source from the content-addressed store, hash-verified

361
362// BenchmarkPoolHighContention tests pool performance under high contention
363func BenchmarkPoolHighContention(b *testing.B) {
364 ctx := context.Background()
365 client := benchmarkClient(32)
366 defer client.Close()
367
368 b.ResetTimer()
369 b.ReportAllocs()
370
371 b.RunParallel(func(pb *testing.PB) {
372 for pb.Next() {
373 // High contention Get/Put operations
374 pubsub := client.Subscribe(ctx, "test-channel")
375 pubsub.Close()
376 }
377 })
378}

Callers

nothing calls this directly

Calls 4

benchmarkClientFunction · 0.85
CloseMethod · 0.65
NextMethod · 0.65
SubscribeMethod · 0.65

Tested by

no test coverage detected