-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
[Merged by Bors] - [profiler] Cache StringId #2495
Conversation
boa_profiler was allocating new strings every time even when they are the same string. This change updates the profiler to use a cache and avoid duplicate allocations.
Codecov Report
@@ Coverage Diff @@
## main #2495 +/- ##
==========================================
+ Coverage 52.40% 53.02% +0.62%
==========================================
Files 339 342 +3
Lines 35170 34720 -450
==========================================
- Hits 18431 18412 -19
+ Misses 16739 16308 -431
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Looks good! I would replace the unwrap
s with expect
s describing why unwrapping is fine though.
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.
Looks fine to me, but I'd say let's change the unwrap
s like @jedel1043 suggested to stick to our normal lint rules.
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.
Looks good to me! :)
bors r+ |
boa_profiler was allocating new strings every time even when they are the same string, which leads to a crash when `start_event` is called too much. This change updates the profiler to use a hash map cache and avoid duplicate string allocations.
Pull request successfully merged into main. Build succeeded: |
boa_profiler was allocating new strings every time even when they are the same string, which leads to a crash when
start_event
is called too much. This change updates the profiler to use a hash map cache and avoid duplicate string allocations.