-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[chore][confighttp] use sync.Pool #13909
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
base: main
Are you sure you want to change the base?
Conversation
When profiling some environments excessive calls to bytes.NewBuffer() and consequently additional GC workload was noticed. Use sync.Pool to reduce this overhead. Signed-off-by: Florian Lehner <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13909 +/- ##
==========================================
- Coverage 91.65% 91.63% -0.03%
==========================================
Files 652 652
Lines 42516 42523 +7
==========================================
- Hits 38970 38965 -5
- Misses 2736 2745 +9
- Partials 810 813 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Could you share either benchmarks showing the improvement, or profiles before and after this change? |
Signed-off-by: Florian Lehner <[email protected]>
@dmathieu here are some numbers:
Feel free to reproduce the results with https://gist.github.com/florianl/22b50787ce38f0d637df17ed7875be42. The benchmark is limited as they show only a limited number of http requests. When applying this change with more http requests and for a longer time, the benefits will be increase. |
sorry @florianl would you please offer the benchmark results before/after on your computer so we can see the diff, using a tool like benchstat? |
Description
When profiling some environments excessive calls to bytes.NewBuffer() and consequently additional GC workload was noticed. Use sync.Pool to reduce this overhead.
Link to tracking issue
Fixes #
Testing
Documentation