We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ad2ae6 commit e9cdce8Copy full SHA for e9cdce8
pkg/controller/priorityqueue/priorityqueue_test.go
@@ -300,6 +300,34 @@ func BenchmarkAddGetDone(b *testing.B) {
300
}
301
302
303
+func BenchmarkAddOnly(b *testing.B) {
304
+ q := New[int]("")
305
+ defer q.ShutDown()
306
+ b.ResetTimer()
307
+ for n := 0; n < b.N; n++ {
308
+ for i := 0; i < 1000; i++ {
309
+ q.Add(i)
310
+ }
311
312
+}
313
+
314
+func BenchmarkAddLockContended(b *testing.B) {
315
316
317
+ go func() {
318
+ for range 1000 {
319
+ item, _ := q.Get()
320
+ q.Done(item)
321
322
+ }()
323
324
325
326
327
328
329
330
331
// TestFuzzPrioriorityQueue validates a set of basic
332
// invariants that should always be true:
333
//
0 commit comments