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

Perf: Increase speed and reduce memory allocations #14

Merged
merged 11 commits into from
Jun 26, 2024
Merged

Perf: Increase speed and reduce memory allocations #14

merged 11 commits into from
Jun 26, 2024

Conversation

yunginnanet
Copy link
Owner

@yunginnanet yunginnanet commented Jun 26, 2024

Old Benchmark

goos: linux
goarch: amd64
pkg: github.com/yunginnanet/Rate5
cpu: 13th Gen Intel(R) Core(TM) i9-13900K
BenchmarkCheck
BenchmarkCheck-32                            	15019285	       83.07 ns/op	     40 B/op	      3 allocs/op
BenchmarkCheckHardcore
BenchmarkCheckHardcore-32                    	6057589	      197.4 ns/op	     64 B/op	      5 allocs/op
BenchmarkCheckStrict
BenchmarkCheckStrict-32                      	6038204	      197.4 ns/op	     64 B/op	      5 allocs/op
BenchmarkCheckStringer
BenchmarkCheckStringer-32                    	12314049	       98.12 ns/op	     56 B/op	      4 allocs/op
BenchmarkPeek
BenchmarkPeek-32                             	25592062	       47.04 ns/op	      0 B/op	      0 allocs/op
BenchmarkConcurrentCheck
BenchmarkConcurrentCheck-32                  	8114398	      153.3 ns/op	     40 B/op	      3 allocs/op
BenchmarkConcurrentSetAndCheckHardcore
BenchmarkConcurrentSetAndCheckHardcore-32    	3432715	      337.3 ns/op	     64 B/op	      5 allocs/op
BenchmarkConcurrentSetAndCheckStrict
BenchmarkConcurrentSetAndCheckStrict-32      	3552456	      353.7 ns/op	     63 B/op	      5 allocs/op
BenchmarkConcurrentPeek
BenchmarkConcurrentPeek-32                   	13633239	       88.90 ns/op	      0 B/op	      0 allocs/op

New Benchmark

goos: linux
goarch: amd64
pkg: github.com/yunginnanet/Rate5
cpu: 13th Gen Intel(R) Core(TM) i9-13900K
BenchmarkCheck
BenchmarkCheck-32                            	19209324	       65.89 ns/op	     32 B/op	      2 allocs/op
BenchmarkCheckHardcore
BenchmarkCheckHardcore-32                    	6872553	      178.7 ns/op	     48 B/op	      3 allocs/op
BenchmarkCheckStrict
BenchmarkCheckStrict-32                      	6791085	      172.1 ns/op	     48 B/op	      3 allocs/op
BenchmarkCheckStringer
BenchmarkCheckStringer-32                    	15779043	       79.50 ns/op	     48 B/op	      3 allocs/op
BenchmarkPeek
BenchmarkPeek-32                             	125360696	        9.582 ns/op	      0 B/op	      0 allocs/op
BenchmarkConcurrentCheck
BenchmarkConcurrentCheck-32                  	22843929	       53.54 ns/op	     32 B/op	      3 allocs/op
BenchmarkConcurrentSetAndCheckHardcore
BenchmarkConcurrentSetAndCheckHardcore-32    	4099572	      287.1 ns/op	     48 B/op	      3 allocs/op
BenchmarkConcurrentSetAndCheckStrict
BenchmarkConcurrentSetAndCheckStrict-32      	4044066	      289.0 ns/op	     48 B/op	      3 allocs/op
BenchmarkConcurrentPeek
BenchmarkConcurrentPeek-32                   	41687407	       32.93 ns/op	      0 B/op	      0 allocs/op
PASS

@yunginnanet yunginnanet merged commit a8483bb into main Jun 26, 2024
3 checks 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.

1 participant