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

Default to elapsed time where possible #154

Merged
merged 4 commits into from
Jul 3, 2024
Merged

Default to elapsed time where possible #154

merged 4 commits into from
Jul 3, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Jul 2, 2024

Fixes #72

@hadley hadley requested a review from lionel- July 2, 2024 13:06
@@ -163,7 +182,10 @@ profvis <- function(expr = NULL,
}
repeat {
inject(Rprof(prof_output, !!!rprof_args))
with_profvis_handlers(expr)
cnd <- with_profvis_handlers(expr)
Copy link
Member Author

Choose a reason for hiding this comment

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

Not related to this PR but with_profvis_handlers captures interrupts so without this there's no way to terminate this loop.

@@ -13,3 +13,13 @@ test_that("Irrelevant stack is trimmed from profiles (#123)", {
out <- repro_profvis(f(), simplify = TRUE)
expect_equal(profvis_modal_value(out$x$message$prof), "pause f")
})

test_that("defaults to elapsed timing", {
skip_on_cran()
Copy link
Member

Choose a reason for hiding this comment

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

skip on old versions of R?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a helper to match has_simplify()

R/profvis.R Outdated Show resolved Hide resolved
R/profvis.R Outdated Show resolved Hide resolved
@hadley hadley merged commit e72eeed into main Jul 3, 2024
13 checks passed
@hadley hadley deleted the elapsed-time branch July 3, 2024 13:24
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.

Profile non-cpu time?
2 participants