MCPcopy
hub / github.com/livekit/livekit / benchmarkPool

Function benchmarkPool

pkg/sfu/receiver_test.go:112–130  ·  view source on GitHub ↗
(b *testing.B, wp *workerpool.WorkerPool, buckets []int)

Source from the content-addressed store, hash-verified

110}
111
112func benchmarkPool(b *testing.B, wp *workerpool.WorkerPool, buckets []int) {
113 for b.Loop() {
114 var wg sync.WaitGroup
115 for j := range buckets {
116 downTracks := buckets[j]
117 if downTracks == 0 {
118 continue
119 }
120 wg.Add(1)
121 wp.Submit(func() {
122 defer wg.Done()
123 for dt := 0; dt < downTracks; dt++ {
124 writeRTP()
125 }
126 })
127 }
128 wg.Wait()
129 }
130}
131
132func benchmarkGoroutine(b *testing.B, buckets []int) {
133 for b.Loop() {

Callers 1

BenchmarkWriteRTPFunction · 0.85

Calls 3

writeRTPFunction · 0.85
DoneMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected