MCPcopy Index your code
hub / github.com/sourcegraph/conc / BenchmarkStream

Function BenchmarkStream

stream/stream_test.go:122–143  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

120}
121
122func BenchmarkStream(b *testing.B) {
123 b.Run("startup and teardown", func(b *testing.B) {
124 for i := 0; i < b.N; i++ {
125 s := New()
126 s.Go(func() Callback { return func() {} })
127 s.Wait()
128 }
129 })
130
131 b.Run("per task", func(b *testing.B) {
132 n := 0
133 s := New()
134 for i := 0; i < b.N; i++ {
135 s.Go(func() Callback {
136 return func() {
137 n += 1
138 }
139 })
140 }
141 s.Wait()
142 })
143}

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
GoMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…