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

localCounter: Use RWMutex to speed up lookups #33

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

VojtechVitek
Copy link
Contributor

No description provided.

Copy link

Benchmark Results

goos: linux
goarch: amd64
pkg: github.com/go-chi/httprate
cpu: AMD EPYC 7763 64-Core Processor                
               │ master.txt  │               pr.txt                │
               │   sec/op    │   sec/op     vs base                │
LocalCounter-4   62.47m ± 1%   43.45m ± 2%  -30.44% (p=0.000 n=10)

               │  master.txt  │               pr.txt                │
               │     B/op     │     B/op      vs base               │
LocalCounter-4   4.363Mi ± 0%   4.378Mi ± 0%  +0.34% (p=0.011 n=10)

               │ master.txt  │               pr.txt               │
               │  allocs/op  │  allocs/op   vs base               │
LocalCounter-4   253.7k ± 0%   253.9k ± 0%  +0.07% (p=0.010 n=10)

@VojtechVitek
Copy link
Contributor Author

-30.44% :)

@VojtechVitek VojtechVitek merged commit c6b43ff into master Jul 24, 2024
3 checks passed
@VojtechVitek VojtechVitek deleted the rwmutex branch July 24, 2024 18:08
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.

1 participant