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
Replace compiled view paths in profiles #747
base: master
Are you sure you want to change the base?
Conversation
{ | ||
// Check if we are dealing with a frame for a cached view path | ||
if (Str::startsWith($frame['filename'], '/storage/framework/views/')) { | ||
$originalViewPath = $this->backtraceHelper()->getOriginalViewPathForCompiledViewPath($frame['abs_path']); |
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.
Could we benchmark the perf overhead?
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.
I think we could but not sure how to quantify, since this does a few I/O operations to read the view file. In this WIP I didn't implement memoizing which could reduce the amount of operations needed when a view is seen multiple times. I could run this code a few iterations on my machine and see what the result is, but it's always an increase since before we didn't do anything.
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.
A rough ballpark would suffice.
This is becoming more relevant now, as we'll ship a new performance issue that alerts users about regressed function durations. Having the path to the actual view file would make these issues more actionable. |
This works with: getsentry/sentry-php#1574, and is a PoC to show what that PR could be used for.
It replaces compiled view paths with their non-compiled paths (the ones you would actually look at in your editor).
Todo:
filename
/function
and not more / other infobase_path
, we might need to addrealpath(storage_path())
as a prefix path to fix this. This requires some more testing / investigating