asynq
asynq copied to clipboard
fix: queues map init with size
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
Not really a fix. But very minimal runtime costs improvement.