8000 pkg/encoding: reduce allocations by narqo · Pull Request #1 · felixge/traceutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pkg/encoding: reduce allocations #1

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

narqo
Copy link
@narqo narqo commented Jan 9, 2023

This is a fairly quick and dirty change, that reduces some obvious allocations :)

name               old time/op    new time/op    delta
AnonymizeTrace-10    33.0µs ± 0%    31.4µs ± 0%   -4.66%  (p=0.008 n=5+5)

name               old alloc/op   new alloc/op   delta
AnonymizeTrace-10    9.82kB ± 0%   10.33kB ± 0%   +5.22%  (p=0.008 n=5+5)

name               old allocs/op  new allocs/op  delta
AnonymizeTrace-10      41.0 ± 0%      19.0 ± 0%  -53.66%  (p=0.008 n=5+5)

(updated the results after running the benchmarks on m1 mac)

@narqo narqo force-pushed the decoder-allocs branch 2 times, most recently from 1d77c90 to 8c2a15f Compare January 10, 2023 08:44
@narqo narqo changed the title pkg/encoding: reduce allocations in decoder pkg/encoding: reduce allocations Jan 10, 2023
@felixge
Copy link
Owner
felixge commented Jan 13, 2023

Hey, thanks for this, I'll take a look when I get a chance. Right now the benchmark is biased towards processing lots of small traces, but for the implementation I probably want to bias towards efficiently processing large traces. I probably need to reflect the benchmark a bit to reflect that.

If I'm reading your code correctly, this would mostly help for processing lots of small traces, right?

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
0