[SDK] Reduce lock contention in SyncMetricStorage for concurrent metric recording#3959
Conversation
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3959 +/- ##
==========================================
+ Coverage 90.18% 90.18% +0.01%
==========================================
Files 230 230
Lines 7298 7299 +1
==========================================
+ Hits 6581 6582 +1
Misses 717 717
🚀 New features to boost your workflow:
|
|
Can the cppcheck errors be suppressed? It reports an “access after move” issue here, but this looks like a false positive. |
The error reported by cpp-check on this line: is indeed hard to understand, I don't get what the exact issue is either. Note that there are 3 different GetOrSetDefault() methods, and as @ThomsonTan pointed out, one of them is dead code: please remove it, it will be one less item that can possibly confuse cpp-check. |
|
This should work to suppress warnings: |
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
Co-authored-by: Marc Alff <marc.alff@free.fr>
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
Fixes #3927
Changes
First set of changes to reduce lock contention: Move MetricAttributes construction outside the lock
Benchmark before:
Benchmark after:
Shared-counter wall time dropped from 4,354us to 2,905us (33% reduction).
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes