asynq icon indicating copy to clipboard operation
asynq copied to clipboard

fix: queues map init with size

Open ghosx opened this issue 2 years ago • 1 comments

Initializing the queue can improve performance and reduce the number of map expansions. When there are 10 queues, the following is my performance test:

goos: linux
goarch: amd64
pkg: go-all-in-one/map
cpu: AMD EPYC 7K62 48-Core Processor
BenchmarkWithSize-8 2684252 447.0 ns/op 576 B/op 1 allocs/op
BenchmarkWithoutSize-8 2147931 557.8 ns/op 292 B/op 1 allocs/op

ghosx avatar Jun 25 '23 09:06 ghosx

Not really a fix. But very minimal runtime costs improvement.

kamikazechaser avatar Jul 24 '23 03:07 kamikazechaser