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

remove global rand. Updating to a rand source per goroutine to avoid locking overhead #6

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

andydunstall
Copy link
Contributor

@andydunstall andydunstall commented Sep 20, 2023

Running against Redis/Dragonfly using Go 1.21.1 found the client was a bottleneck as the global rand functions were blocked on the global lock (Go locks global rand functions when it sets a seed) - so updating to a rand source per goroutine

Running ./redis-zbench-go -mode load -r 100000 locally against redis went from ~5 rps to ~15 rps (and lower CPU on the benchmark)

@filipecosta90 filipecosta90 added the enhancement New feature or request label Sep 20, 2023
redis-zbench-go.go Show resolved Hide resolved
@filipecosta90 filipecosta90 changed the title remove global rand remove global rand. Updating to a rand source per goroutine to avoid locking overhead Sep 20, 2023
@filipecosta90
Copy link
Collaborator

filipecosta90 commented Sep 20, 2023

Thank you @andydunstall . Merging... :)

EDIT: released as part of https://github.com/redis-performance/redis-zbench-go/releases/tag/v0.0.3

@filipecosta90 filipecosta90 merged commit 8e51771 into redis-performance:main Sep 20, 2023
3 checks passed
@andydunstall
Copy link
Contributor Author

Great thanks for reviewing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants