Browse Source

Update buffered_queue_test.go

pull/5637/head
chrislu 1 year ago
parent
commit
fa835c9319
  1. 6
      weed/util/buffered_queue/buffered_queue_test.go

6
weed/util/buffered_queue/buffered_queue_test.go

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