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

Refactor: better stack traces for profiling #980

Merged
merged 4 commits into from
Sep 11, 2022
Merged

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Aug 21, 2022

This allows replacing %>% with |> which gives much much better stack traces for profiling. Also replaced one call to map2() which is very high in the chain, also for clearer stack traces.

For #759.

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2022

Codecov Report

Merging #980 (dbb867e) into main (bbc4eef) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #980      +/-   ##
==========================================
+ Coverage   90.23%   90.24%   +0.01%     
==========================================
  Files          47       47              
  Lines        2694     2697       +3     
==========================================
+ Hits         2431     2434       +3     
  Misses        263      263              
Impacted Files Coverage Δ
R/nest.R 100.00% <100.00%> (ø)
R/roxygen-examples-parse.R 96.82% <100.00%> (-0.05%) ⬇️
R/transform-files.R 97.29% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Aug 21, 2022

Looks good. Also note there is #937. Do youw awant to merge this PR as is or also perfrom the substitution as part of this PR? A limitation of using pre-commit with GitHub Actions is pushes by pre-commit (to fix problems) don't trigger other CI runs. To avoid that, either force push the changes afterwards, create an emtpy bump commit or install pre-commit locally so it's ran on every commit, i.e. on macos, I use $ brew install pre-commit for the system installation and then $ pre-commit install in this package directory.

@krlmlr
Copy link
Member Author

krlmlr commented Aug 21, 2022

We want styler to run on R < 4.1, I'm doing the substitution temporarily.

Thanks for the hints on pre-commit. It's unfortunate that automated pushes don't trigger a CI/CD rerun.

@github-actions
Copy link
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if c0932f5 is merged into main:

  •   :ballot_box_with_check:cache_applying: 32.3ms -> 32.2ms [-1.74%, +1.15%]
  •   :ballot_box_with_check:cache_recording: 1.51s -> 1.51s [-1.09%, +0.76%]
  •   :ballot_box_with_check:without_cache: 4s -> 4s [-0.56%, +0.64%]

Further explanation regarding interpretation and methodology can be found in the documentation.

@lorenzwalthert
Copy link
Collaborator

Thanks for the hints on pre-commit. It's unfortunate that automated pushes don't trigger a CI/CD rerun.

yes. That’s not a pre-commit specific problem I think. And the reason why there is https://pre-commit.ci (but that integration is not (yet) activated for r-lib)

@krlmlr
Copy link
Member Author

krlmlr commented Aug 21, 2022

I don't understand the test failures here.

@lorenzwalthert
Copy link
Collaborator

That's a speed test that ensure caching works as expected from a performance point of view. It's an outlier, so re-runnig the test again should pass. We could also lift the threshold a bit. Up to you. Happy to merge this.

@krlmlr krlmlr marked this pull request as draft September 11, 2022 05:30
@krlmlr krlmlr marked this pull request as ready for review September 11, 2022 05:31
@github-actions
Copy link
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if bb30612 is merged into main:

  •   :ballot_box_with_check:cache_applying: 26.8ms -> 26.8ms [-0.64%, +0.58%]
  •   :ballot_box_with_check:cache_recording: 1.25s -> 1.24s [-1.47%, +0.14%]
  •   :ballot_box_with_check:without_cache: 3.3s -> 3.3s [-0.6%, +0.23%]

Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link
Collaborator

@lorenzwalthert lorenzwalthert left a comment

Choose a reason for hiding this comment

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

Looks good. I can fix failing test later, they are just very specific benchmarks that we want to keep an eye on.

@lorenzwalthert lorenzwalthert merged commit 340e07b into main Sep 11, 2022
@lorenzwalthert lorenzwalthert deleted the f-558-prof branch September 11, 2022 10:03
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.

3 participants