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

scale_*_bench_*() functions obscure lower values #143

Open
simonpcouch opened this issue Jul 8, 2024 · 0 comments · May be fixed by #144
Open

scale_*_bench_*() functions obscure lower values #143

simonpcouch opened this issue Jul 8, 2024 · 0 comments · May be fixed by #144

Comments

@simonpcouch
Copy link

I've found that the defaults for scale_y_bench_bytes() and friends often result in axis ticks / grid panels only being applied to the (visually) upper quartile of values. Here's an example from the bench::press() docs:

library(ggplot2)
library(bench)

create_df <- function(rows, cols) {
  as.data.frame(setNames(
    replicate(cols, runif(rows, 1, 1000), simplify = FALSE),
    rep_len(c("x", letters), cols)))
}

# Run 4 data sizes across 3 samples with 2 replicates (24 total benchmarks)
bm <- press(
  rows = c(1000, 10000),
  cols = c(10, 100),
  rep = 1:2,
  {
    dat <- create_df(rows, cols)
    bench::mark(
      min_time = .05,
      bracket = dat[dat$x > 500, ],
      which = dat[which(dat$x > 500), ],
      subset = subset(dat, x > 500)
    )
  }
)
#> Running with:
#>    rows  cols   rep
#> 1  1000    10     1
#> 2 10000    10     1
#> 3  1000   100     1
#> 4 10000   100     1
#> 5  1000    10     2
#> 6 10000    10     2
#> 7  1000   100     2
#> 8 10000   100     2
#> Warning: Some expressions had a GC in every iteration; so filtering is
#> disabled.
ggplot(bm) + aes(x = median, y = mem_alloc) + geom_point()
#> Warning: The `trans` argument of `continuous_scale()` is deprecated as of ggplot2 3.5.0.
#> ℹ Please use the `transform` argument instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Created on 2024-07-08 with reprex v2.1.0

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 a pull request may close this issue.

1 participant