Introduction

This is mostly to keep track of how the performance of different functions changes across time.

ggbetweenstats

library(ggstatsplot)

set.seed(123)
bench::mark(
  ggbetweenstats(
    data = dplyr::filter(
      .data = movies_long,
      genre %in% c("Action", "Action Comedy", "Action Drama", "Comedy")
    ),
    x = mpaa,
    y = length
  )
) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    1.68s    1.68s     0.597     233MB     3.58

set.seed(123)
bench::mark(
  grouped_ggbetweenstats(
    data = dplyr::filter(
      .data = movies_long,
      genre %in% c("Action", "Action Comedy", "Action Drama", "Comedy")
    ),
    x = mpaa,
    y = length,
    grouping.var = genre
  )
) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    3.21s    3.21s     0.312     244MB     1.87

ggwithinstats

library(ggstatsplot)

set.seed(123)
bench::mark(
  ggwithinstats(
    data = bugs_long,
    x = condition,
    y = desire
  )
) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    13.9s    13.9s    0.0719     659MB    0.863

set.seed(123)
bench::mark(
  grouped_ggwithinstats(
    data = bugs_long,
    x = condition,
    y = desire,
    grouping.var = gender
  )
) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    9.81s    9.81s     0.102     627MB    0.917

gghistostats

library(ggstatsplot)

set.seed(123)
bench::mark(gghistostats(mtcars, wt, test.value = 3)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    177ms    195ms      5.25    4.72MB        0

set.seed(123)
bench::mark(grouped_gghistostats(mtcars, wt, test.value = 3, grouping.var = am)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    393ms    403ms      2.48    5.95MB     2.48

ggdotplotstats

library(ggstatsplot)

set.seed(123)
bench::mark(ggdotplotstats(
  dplyr::filter(.data = ggplot2::mpg, cyl %in% c("4", "6")),
  cty,
  manufacturer,
  test.value = 15
)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    193ms    199ms      5.02    3.18MB     2.51

set.seed(123)
bench::mark(
  grouped_ggdotplotstats(
    dplyr::filter(.data = ggplot2::mpg, cyl %in% c("4", "6")),
    cty,
    manufacturer,
    test.value = 15,
    grouping.var = cyl
  )
) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    404ms    404ms      2.48    5.82MB     2.48

ggscatterstats

library(ggstatsplot)

set.seed(123)
bench::mark(ggscatterstats(mtcars, wt, mpg)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    404ms    408ms      2.45    19.8MB     2.45

set.seed(123)
bench::mark(grouped_ggscatterstats(mtcars, wt, mpg, grouping.var = am)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    788ms    788ms      1.27    16.4MB     2.54

ggcorrmat

library(ggstatsplot)

set.seed(123)
bench::mark(ggcorrmat(iris)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1     27ms   27.7ms      35.4    1.11MB     2.08

set.seed(123)
bench::mark(grouped_ggcorrmat(iris, grouping.var = Species)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1   92.4ms   97.9ms      10.3     482KB     2.06

ggpiestats

library(ggstatsplot)

set.seed(123)
bench::mark(ggpiestats(mtcars, cyl)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    2.44s    2.44s     0.411      14MB     2.87

set.seed(123)
bench::mark(grouped_ggpiestats(mtcars, cyl, grouping.var = am)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    5.11s    5.11s     0.196    25.4MB     2.54

ggbarstats

library(ggstatsplot)

set.seed(123)
bench::mark(ggbarstats(ggplot2::mpg, fl, class)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    5.87s    5.87s     0.170     286MB     1.36

set.seed(123)
bench::mark(grouped_ggbarstats(ggplot2::mpg, fl, class, grouping.var = drv)) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    14.7s    14.7s    0.0681     538MB     1.91

ggcoefstats

library(ggstatsplot)

set.seed(123)
bench::mark(ggcoefstats(stats::lm(formula = wt ~ am * cyl, data = mtcars))) %>%
  dplyr::select(-expression)
#> # A tibble: 1 x 5
#>        min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1    348ms    348ms      2.88       4MB     2.88

Suggestions

If you find any bugs or have any suggestions/remarks, please file an issue on GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues