Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse allocated directItems in queue #3

Merged
merged 1 commit into from
May 20, 2024

Conversation

LubosD
Copy link
Contributor

@LubosD LubosD commented May 20, 2024

No idea if you're going accept such a change, but I have a project that runs lots of items through your queue (up to 130k/s) and I see a nice CPU usage reduction if I use sync.Pool to reuse the directItem instances.

@changkun
Copy link
Member

Thanks for contributing 👍

@changkun changkun merged commit 63bf999 into golang-design:master May 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants