Server uses sync.Pool for gzip.Writer allocations#484
Conversation
af30fb6 to
bdaff56
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #484 +/- ##
==========================================
+ Coverage 81.71% 81.77% +0.06%
==========================================
Files 27 27
Lines 2122 2129 +7
==========================================
+ Hits 1734 1741 +7
Misses 263 263
Partials 125 125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Please break this down into individual PRs, one PR per topic.
Please add a benchmark that shows before/after memory/CPU usage and demonstrates the improvement. |
|
Callback fix pr: #488 |
|
non gwPool changes: #489 I'm going to rewrite this PR's history so that the 1st commit has both compress methods, and a benchmark for them, and the 2nd commit only has the (new) pool method. |
a73d4c2 to
ec10b07
Compare
Use of gzip.Writer pool for plain HTTP responses - gzip.Writers have a large memory footprint, if many agent clients clients were to respond at once a server could have an OOM crash. Use of the pool also reduces allocs.