Skip to content

Commit

Permalink
Merge pull request #220 from ugurcsen/patch-1
Browse files Browse the repository at this point in the history
Benchmark bug fixed(interface conversion).
  • Loading branch information
emirpasic authored Jan 18, 2023
2 parents 5dd72bf + 9f3e98d commit 702a6b2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions queues/priorityqueue/priorityqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func TestBTreeString(t *testing.T) {
func benchmarkEnqueue(b *testing.B, queue *Queue, size int) {
for i := 0; i < b.N; i++ {
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
}
}
Expand All @@ -494,7 +494,7 @@ func BenchmarkBinaryQueueDequeue100(b *testing.B) {
size := 100
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkDequeue(b, queue, size)
Expand All @@ -505,7 +505,7 @@ func BenchmarkBinaryQueueDequeue1000(b *testing.B) {
size := 1000
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkDequeue(b, queue, size)
Expand All @@ -516,7 +516,7 @@ func BenchmarkBinaryQueueDequeue10000(b *testing.B) {
size := 10000
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkDequeue(b, queue, size)
Expand All @@ -527,7 +527,7 @@ func BenchmarkBinaryQueueDequeue100000(b *testing.B) {
size := 100000
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkDequeue(b, queue, size)
Expand All @@ -546,7 +546,7 @@ func BenchmarkBinaryQueueEnqueue1000(b *testing.B) {
size := 1000
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkEnqueue(b, queue, size)
Expand All @@ -557,7 +557,7 @@ func BenchmarkBinaryQueueEnqueue10000(b *testing.B) {
size := 10000
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkEnqueue(b, queue, size)
Expand All @@ -568,7 +568,7 @@ func BenchmarkBinaryQueueEnqueue100000(b *testing.B) {
size := 100000
queue := NewWith(byPriority)
for n := 0; n < size; n++ {
queue.Enqueue(n)
queue.Enqueue(Element{})
}
b.StartTimer()
benchmarkEnqueue(b, queue, size)
Expand Down

0 comments on commit 702a6b2

Please sign in to comment.