-
Notifications
You must be signed in to change notification settings - Fork 149
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(profiling): use an arena-based string table #2511
Conversation
e614517
to
c7864cb
Compare
The arena capacity probably needs some tweaking, and should probably be set to a specific target set by the team after careful consideration. The memory is lazily populated by the OS, at least. Adjust log levels as certain errors will now be more common. Use const thread_local for runtime stats (slightly cheaper).
c7864cb
to
60d7dd5
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2511 +/- ##
============================================
+ Coverage 75.91% 77.08% +1.16%
Complexity 2574 2574
============================================
Files 240 214 -26
Lines 27029 23057 -3972
Branches 976 0 -976
============================================
- Hits 20519 17773 -2746
+ Misses 5990 5284 -706
+ Partials 520 0 -520
Flags with carried forward coverage won't be shown. Click here to find out more. see 26 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
This may fix an issue with old rust with new ahash version
Superseded by #2668. |
Description
This updates libdatadog to use a branch which has an arena-based string table. See DataDog/libdatadog#306.
The arena capacity probably needs some tweaking, and should probably be set to a specific target set by the team after careful consideration. The memory is lazily populated by the OS, at least, so it's not automatically used (asking for 512 MiB won't allocate all 512 MiB immediately, it will grow up to that limit and then stop).
Part of PROF-9123.
Overhead
Using the symfony/demo with PHP 8.3 using php-fpm, this netted me about 3-4% less total container memory. I expected there to be a difference because:
u16
, so we save a few bytes per string compared to ausize
.I'm happy with 3-4% off the container, and don't feel a need to try to specifically calculate the reduction of just libdatadog's memory.
I haven't attempted to measure CPU rigorously. Unscientifically, it looks on par with master. I would expect a very slight win with this PR because arena allocators are quick to allocate, and we can skip deallocation altogether (but deallocation is infrequent, roughly once per minute). Since eyeballing it looks on-par with master, which was the expectation, I won't dive into it deeper.
Reviewer checklist