Browse Source

Update buffered_queue_test.go

pull/5637/head
chrislu 12 months ago
parent
commit
fa835c9319
  1. 16
      weed/util/buffered_queue/buffered_queue_test.go

16
weed/util/buffered_queue/buffered_queue_test.go

@ -86,15 +86,11 @@ func BenchmarkBufferedQueue(b *testing.B) {
queue := NewBufferedQueue[Job[string]](1024, true)
b.Run("Enqueue", func(b *testing.B) {
for i := 0; i < b.N; i++ {
queue.Enqueue(Job[string]{ID: i, Action: "task", Data: "data"})
}
})
for i := 0; i < b.N; i++ {
queue.Enqueue(Job[string]{ID: i, Action: "task", Data: "data"})
}
for i := 0; i < b.N; i++ {
_, _ = queue.Dequeue()
}
b.Run("Dequeue", func(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = queue.Dequeue()
}
})
}
Loading…
Cancel
Save