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

Bench2 #201

Open
wants to merge 6 commits into
base: v2.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
pull_request:
branches:
- v2*

name: bench

jobs:
bench:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::bench
any::nycflights13
any::remotes
- name: install current version
run: remotes::install_github("ropensci/readODS")
shell: Rscript {0}
- name: run bench.R with the current version
run: Rscript benchmark/bench.R HEAD
- name: install PR version
run: remotes::install_local(".", upgrade = "never")
shell: Rscript {0}
- name: run bench.R with the PR version
run: Rscript benchmark/bench.R PR
- name: Print the benchmark
run: Rscript benchmark/print_bench.R
4 changes: 4 additions & 0 deletions benchmark/bench.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env Rscript
args <- commandArgs(trailingOnly = TRUE)

saveRDS(bench::mark(readODS::read_ods(readODS::write_ods(nycflights13::flights)), min_iterations = 3), paste0("benchmark/", args[1], "_write_ods_.RDS"))
9 changes: 9 additions & 0 deletions benchmark/print_bench.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library(bench)
prefixes <- c("HEAD", "PR")

## TODO: make this a GH comment

for (prefix in prefixes) {
cat(prefix, "\n")
cat(readRDS(paste0("benchmark/", prefix, "_write_ods_.RDS"))$median, "\n")
}
Empty file modified tests/testdata/multiline_cells.ods
100755 → 100644
Empty file.
Loading