Use slice instead of list, no map

benchmark                           old ns/op     new ns/op     delta
BenchmarkJobQueueBump               345           154498        +44682.03%
BenchmarkJobQueuePushPopDone10k     9437373       3258204       -65.48%

benchmark                           old allocs     new allocs     delta
BenchmarkJobQueueBump               0              0              +0.00%
BenchmarkJobQueuePushPopDone10k     10565          22             -99.79%

benchmark                           old bytes     new bytes     delta
BenchmarkJobQueueBump               0             0             +0.00%
BenchmarkJobQueuePushPopDone10k     1452498       385869        -73.43%
This commit is contained in:
Jakob Borg
2014-12-30 09:07:58 +01:00
parent 8f72ae9da2
commit 34deb82aea
2 changed files with 18 additions and 27 deletions

View File

@@ -72,7 +72,7 @@ func TestJobQueue(t *testing.T) {
}
}
if len(q.progress) > 0 || q.queued.Len() != 4 {
if len(q.progress) > 0 || len(q.queued) != 4 {
t.Fatal("Wrong length")
}