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(
      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    3.48s    3.48s     0.288     266MB     2.59

set.seed(123)
bench::mark(
  grouped_ggbetweenstats(
    data = dplyr::filter(
      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    7.11s    7.11s     0.141     252MB     1.27

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.5s    13.5s    0.0740     656MB    0.740

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    10.4s    10.4s    0.0957     631MB    0.861

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    321ms    321ms      3.11    4.06MB     3.11

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    645ms    645ms      1.55    4.42MB     1.55

ggdotplotstats

library(ggstatsplot)

set.seed(123)
bench::mark(ggdotplotstats(
  dplyr::filter(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    416ms    416ms      2.40    2.35MB     2.40

set.seed(123)
bench::mark(
  grouped_ggdotplotstats(
    dplyr::filter(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    722ms    722ms      1.38    4.13MB     1.38

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   80.7ms     91ms      11.0    5.48MB        0

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    196ms    213ms      4.69    3.92MB     2.35

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   30.1ms   33.3ms      30.3    1.52MB     2.16

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   79.6ms   86.7ms      11.0     478KB     2.19

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.63s    2.63s     0.381    13.9MB     2.28

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.31s    5.31s     0.188    25.5MB     2.26

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    8.96s    8.96s     0.112     286MB     2.01

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    41.9s    41.9s    0.0239     537MB    0.668

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    461ms    461ms      2.17    4.32MB     2.17

Suggestions

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