fix: lifetime issue cached filename - #2182
Merged
Merged
Conversation
BenchmarksBenchmark execution time: 2023-08-01 15:37:38 Comparing candidate commit 7e8d799 in PR branch Found 0 performance improvements and 6 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics. scenario:walk_stack/1
scenario:walk_stack/50
scenario:walk_stack/99
scenario:walk_stack_instructions/1
scenario:walk_stack_instructions/50
scenario:walk_stack_instructions/99
|
The function part of the cache already had fixed this issue, but it seems the filename portion was overlooked. With this, there are no reasons anymore to have a Cow<str> instead of a String for filename specifically, so I change that in the ZendFrame struct as well. perf: drop filename from the run time cache Since it was now getting copied every time, and the logic to obtain it is not complex, it doesn't justify the usage of the cache. test: attempt to fix flaky test
morrisonlevi
force-pushed
the
levi/filename-cache
branch
from
July 31, 2023 22:21
0529ea3 to
e4584a8
Compare
realFlowControl
force-pushed
the
levi/filename-cache
branch
from
August 1, 2023 06:57
132724e to
079398e
Compare
morrisonlevi
marked this pull request as ready for review
August 1, 2023 14:20
realFlowControl
approved these changes
Aug 2, 2023
| return cache_addr + ddog_php_prof_run_time_cache_handle; | ||
|
|
||
| #else | ||
| (void)func; |
Member
There was a problem hiding this comment.
question: what does this actually do?
Collaborator
There was a problem hiding this comment.
skip unused variable warnings
Collaborator
Author
There was a problem hiding this comment.
Yeah, this is C convention to cause a variable to be used and therefore avoid a warning about an unused parameter/variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This issue hasn't shipped to customers, as the issue was only introduced in #1998 and it isn't included in any releases. The string table gets reset on each request, so the
ZendFramemay reference invalid memory when sent across the channel.With this, there are no reasons anymore to have a
Cow<str>instead of a String for filename specifically, so I change that in theZendFramestruct as well.The filename cache slot is retained because the
String::from_utf8_lossyis expensive enough to warrant caching it.Readiness checklist
Reviewer checklist