MCPcopy Create free account
hub / github.com/LyricTian/queue / BenchmarkQueue

Function BenchmarkQueue

chan_queue_test.go:68–82  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

66}
67
68func BenchmarkQueue(b *testing.B) {
69 q := NewQueue(10, 100)
70 q.Run()
71
72 b.ResetTimer()
73 b.RunParallel(func(pb *testing.PB) {
74 for pb.Next() {
75 job := NewJob("", func(v interface{}) {
76 _ = v
77 })
78 q.Push(job)
79 }
80 })
81 q.Terminate()
82}

Callers

nothing calls this directly

Calls 5

RunMethod · 0.95
PushMethod · 0.95
TerminateMethod · 0.95
NewQueueFunction · 0.85
NewJobFunction · 0.85

Tested by

no test coverage detected