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: optimize allocations in dictionaries #1610

Merged
merged 7 commits into from
Oct 18, 2022

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Oct 10, 2022

Currently we observe high CPU time consumption of Go GC in certain cases:
image

Significant part of the objects are allocated at tree serialisation when node labels are encoded using dictionaries: notice that the function is called twice, on TTL interval and at memory-pressure-based eviction – in practice, it can reach ~40% of objects:
image

It is interesting that the second biggest consumer is varint.NewWriter which allocates a tiny buffer.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2022

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
webapp/public/assets/app.js 444.86 KB (0%) 8.9 s (0%) 2.9 s (-7.86% 🔽) 11.8 s
webapp/public/assets/app.css 17.68 KB (0%) 354 ms (0%) 0 ms (+100% 🔺) 354 ms
webapp/public/assets/styles.css 9.5 KB (0%) 191 ms (0%) 0 ms (+100% 🔺) 191 ms
packages/pyroscope-flamegraph/dist/index.js 92.19 KB (0%) 1.9 s (0%) 1.3 s (+44.19% 🔺) 3.2 s
packages/pyroscope-flamegraph/dist/index.node.js 92.08 KB (0%) 1.9 s (0%) 604 ms (+18.24% 🔺) 2.5 s
packages/pyroscope-flamegraph/dist/index.css 7.4 KB (0%) 148 ms (0%) 0 ms (+100% 🔺) 148 ms

@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Base: 66.59% // Head: 66.59% // No change to project coverage 👍

Coverage data is based on head (1657a16) compared to base (7c83b32).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1610   +/-   ##
=======================================
  Coverage   66.59%   66.59%           
=======================================
  Files         148      148           
  Lines        5030     5030           
  Branches     1162     1162           
=======================================
  Hits         3349     3349           
  Misses       1676     1676           
  Partials        5        5           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kolesnikovae kolesnikovae changed the title perf: use byte buffer pool in dictionaries perf: optimize allocations in dictionaries Oct 11, 2022
@kolesnikovae kolesnikovae marked this pull request as ready for review October 11, 2022 12:58
@kolesnikovae
Copy link
Collaborator Author

/create-server

@kolesnikovae kolesnikovae merged commit f8d52f5 into main Oct 18, 2022
@kolesnikovae kolesnikovae deleted the perf/optimize-dict-allocs branch October 18, 2022 14:28
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