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

Add benchmarking infra #674

Merged
merged 13 commits into from Oct 18, 2020
Merged

Conversation

lorenzwalthert
Copy link
Collaborator

@lorenzwalthert lorenzwalthert commented Sep 26, 2020

Using bench::mark() and friends, we build a continuous benchmarking system. For any PR there is, we create a boxplot to visualise the distribution for timings for the base branch (e.g. master) and the branch we want to merge into the base branch (head) in one plot.

Todo:

  • Use more representative code (also analysis, Rmd etc.). We could even store this code in the styler repo, just not underbench/ directly. We should probably run two styler commands - Some files should be partly styled to test caching of top level expressions.
  • Use repo we have full control over instead of public r-lib repo.
  • maybe create versioning for the benchmarked code, so we can later switch and know what we are comparing. This can be done with the name arugment in bench::mark().

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2020

Codecov Report

Merging #674 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #674   +/-   ##
=======================================
  Coverage   90.42%   90.42%           
=======================================
  Files          47       47           
  Lines        2224     2224           
=======================================
  Hits         2011     2011           
  Misses        213      213           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3555174...3751fc2. Read the comment docs.

file = paste0("plots/", new_bm_label, ".pdf")) {
new_bm <- bench::as_bench_mark(new_bm)
branches <- gert::git_branch_list()
master <- branches[branches$name == "master", "commit", drop = TRUE]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

make this more generic for target branch != master.

#' @param new_bm A new benchmark object.
#' @param new_bm_label The label of the new benchmark used as a title.
#' @param file The file path to write the plot.
plot_against_master <- function(new_bm,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

more generic, not just master (also in title).

@codecov-io
Copy link

codecov-io commented Oct 18, 2020

Codecov Report

Merging #674 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #674   +/-   ##
=======================================
  Coverage   90.43%   90.43%           
=======================================
  Files          47       47           
  Lines        2226     2226           
=======================================
  Hits         2013     2013           
  Misses        213      213           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f9d137...b663a40. Read the comment docs.

This is only relevant on first fetch when there are no benchmarks yet
@lorenzwalthert lorenzwalthert merged commit c50338f into r-lib:master Oct 18, 2020
2 checks passed
@lorenzwalthert lorenzwalthert deleted the benchmarking branch January 27, 2021 22:40
@lorenzwalthert lorenzwalthert restored the benchmarking branch February 20, 2021 22:47
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.

None yet

3 participants