From fa835c93195d9effee2d513ce628bce87a5f3201 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 27 Jan 2024 14:46:12 -0800 Subject: [PATCH] Update buffered_queue_test.go --- weed/util/buffered_queue/buffered_queue_test.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/weed/util/buffered_queue/buffered_queue_test.go b/weed/util/buffered_queue/buffered_queue_test.go index c4236cd40..0dc96a083 100644 --- a/weed/util/buffered_queue/buffered_queue_test.go +++ b/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() - } - }) }