Skip to content
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

Simpler approaching to removing call suffix #172

Merged
merged 5 commits into from
Sep 17, 2024
Merged

Simpler approaching to removing call suffix #172

merged 5 commits into from
Sep 17, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Sep 16, 2024

Fixes #130

@hadley hadley requested a review from lionel- September 17, 2024 12:38
Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant!

R/profvis.R Outdated

# Use unique name so we can easily trim below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs some comments about why we use new_function() here. This is hard to explain but here is an attempt:

The goal is for the quoted expression to be directly called by a function that we can detect in both raw and simplified stack traces. In the simplified case, it's important for the function to directly call the profiled code and not just force a promise containing it, since in that case the sentinel function gets simplified away.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need to document the behaviour change that we now evaluate in a child of env.

@@ -1,5 +1,6 @@
# profvis (development version)

* New technique for trimming uninteresting frames from the stack (#130). This requires a new evaluationg model where the code you supply to `profvis()` is turned into the body of a zero-argument anonymous function that is then called by profvis. This subtly changes the semantics of evaluation, but it's very unlikely to affect the type of code that you are typically profiling.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* New technique for trimming uninteresting frames from the stack (#130). This requires a new evaluationg model where the code you supply to `profvis()` is turned into the body of a zero-argument anonymous function that is then called by profvis. This subtly changes the semantics of evaluation, but it's very unlikely to affect the type of code that you are typically profiling.
* New technique for trimming uninteresting frames from the stack (#130). This requires a new evaluation model where the code you supply to `profvis()` is turned into the body of a zero-argument anonymous function that is then called by profvis. This subtly changes the semantics of evaluation, but it's very unlikely to affect the type of code that you are typically profiling.

@hadley hadley merged commit 7e3b532 into main Sep 17, 2024
13 checks passed
@hadley hadley deleted the simpler_suffix branch September 17, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stacks sometimes show profvis
3 participants