-
Notifications
You must be signed in to change notification settings - Fork 27
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
Improve memory performance of collector #331
Improve memory performance of collector #331
Conversation
Before change:
After change:
|
@heanlan @dreamtalen let me know if you think this is not a correct change (functionality-wise) |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
==========================================
- Coverage 73.25% 72.87% -0.39%
==========================================
Files 19 19
Lines 2808 2831 +23
==========================================
+ Hits 2057 2063 +6
- Misses 581 599 +18
+ Partials 170 169 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Avoid unnecessary slice creation when adding a record to a set. We implement this change for both data record and template records, but in practice most of the gains will come from data records. Memory allocations (in bytes) are reduced by around 15% for BenchmarkCollector. Signed-off-by: Antonin Bas <abas@vmware.com>
b3d6e26
to
6d7c889
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Do we still need to keep the original AddRecord
?
Since it's a public API of the library, and there was no strong reason to remove it, I just kept it |
Avoid unnecessary slice creation when adding a record to a set. We implement this change for both data record and template records, but in practice most of the gains will come from data records. Memory allocations (in bytes) are reduced by around 15% for BenchmarkCollector. Signed-off-by: Antonin Bas <abas@vmware.com>
Avoid unnecessary slice creation when adding a record to a set. We implement this change for both data record and template records, but in practice most of the gains will come from data records. Memory allocations (in bytes) are reduced by around 15% for BenchmarkCollector. Signed-off-by: Antonin Bas <abas@vmware.com>
Avoid unnecessary slice creation when adding a record to a set. We implement this change for both data record and template records, but in practice most of the gains will come from data records.
Memory allocations (in bytes) are reduced by around 15% for BenchmarkCollector.