MCPcopy Index your code
hub / github.com/flant/shell-operator / benchmarkGetFirst

Function benchmarkGetFirst

pkg/task/queue/task_queue_benchmark_test.go:120–128  ·  view source on GitHub ↗
(b *testing.B, queue Queue, size int)

Source from the content-addressed store, hash-verified

118}
119
120func benchmarkGetFirst(b *testing.B, queue Queue, size int) {
121 for i := 0; i < size; i++ {
122 queue.AddLast(newBenchmarkTask())
123 }
124 b.ResetTimer()
125 for i := 0; i < b.N; i++ {
126 queue.GetFirst()
127 }
128}
129
130func benchmarkGetByID(b *testing.B, queue Queue, size int) {
131 uuids := make([]string, 0, size)

Calls 3

newBenchmarkTaskFunction · 0.85
AddLastMethod · 0.65
GetFirstMethod · 0.65

Tested by

no test coverage detected