[PR #673] [MERGED] fix: queues map init with size #1816

Closed
opened 2026-03-07 22:13:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/673
Author: @ghosx
Created: 6/25/2023
Status: Merged
Merged: 11/11/2024
Merged by: @kamikazechaser

Base: masterHead: feature/queuesInitWithSize


📝 Commits (1)

  • e99a0f6 fix: queues map init with size

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 internal/base/base.go (+2 -2)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hibiken/asynq/pull/673 **Author:** [@ghosx](https://github.com/ghosx) **Created:** 6/25/2023 **Status:** ✅ Merged **Merged:** 11/11/2024 **Merged by:** [@kamikazechaser](https://github.com/kamikazechaser) **Base:** `master` ← **Head:** `feature/queuesInitWithSize` --- ### 📝 Commits (1) - [`e99a0f6`](https://github.com/hibiken/asynq/commit/e99a0f6cc0b928c684106f516417a270aec27b03) fix: queues map init with size ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `internal/base/base.go` (+2 -2) </details> ### 📄 Description Initializing the queue can improve performance and reduce the number of map expansions. When there are 10 queues, the following is my performance test: ```shell 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 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 22:13:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#1816
No description provided.