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

Reduce allocations when generating sequences #55

Closed
wants to merge 1 commit into from

Conversation

dirkschumacher
Copy link
Contributor

@dirkschumacher dirkschumacher commented May 20, 2024

An experiment to reduce allocations

name                                       old time/op    new time/op    delta
pkg:github.com/nextmv-io/nextroute goos:darwin goarch:arm64
SequenceGeneratorSequence-8                  1.62µs ± 1%    1.65µs ± 1%   +1.94%  (p=0.000 n=9+9)
SequenceGenerator3-8                         14.8µs ± 2%    11.8µs ± 1%  -20.03%  (p=0.000 n=10+10)
pkg:github.com/nextmv-io/nextroute/tests/golden goos:darwin goarch:arm64
Golden/testdata/complex_precedence.json-8   24.0ms ±101%   32.3ms ±108%     ~     (p=0.315 n=10+10)

name                                       old alloc/op   new alloc/op   delta
pkg:github.com/nextmv-io/nextroute goos:darwin goarch:arm64
SequenceGeneratorSequence-8                    467B ± 2%      454B ± 0%   -2.88%  (p=0.000 n=9+9)
SequenceGenerator3-8                         6.27kB ± 1%    5.01kB ± 1%  -20.01%  (p=0.000 n=10+10)
pkg:github.com/nextmv-io/nextroute/tests/golden goos:darwin goarch:arm64
Golden/testdata/complex_precedence.json-8    3.50MB ±92%    4.05MB ±91%     ~     (p=0.529 n=10+10)

name                                       old allocs/op  new allocs/op  delta
pkg:github.com/nextmv-io/nextroute goos:darwin goarch:arm64
SequenceGeneratorSequence-8                    10.0 ± 0%       9.0 ± 0%  -10.00%  (p=0.000 n=10+10)
SequenceGenerator3-8                           71.0 ± 0%      31.0 ± 0%  -56.34%  (p=0.000 n=10+10)
pkg:github.com/nextmv-io/nextroute/tests/golden goos:darwin goarch:arm64
Golden/testdata/complex_precedence.json-8     42.4k ±93%     44.1k ±92%     ~     (p=0.853 n=10+10)

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