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    1.86s    1.86s     0.539     241MB     3.23

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     4.9s     4.9s     0.204     252MB     2.45

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.6s    13.6s    0.0736     664MB    0.883

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.2s    10.2s    0.0985     631MB    0.985

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    319ms    319ms      3.13    4.99MB     3.13

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    665ms    665ms      1.50    6.17MB     1.50

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    353ms    363ms      2.75     3.2MB        0

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    700ms    700ms      1.43    5.89MB        0

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   82.8ms   84.7ms      11.5    6.19MB        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    171ms    174ms      5.75    3.92MB     2.88

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   25.3ms   26.3ms      34.3    1.53MB        0

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   85.3ms     88ms      10.7     498KB     2.15

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.25s    2.25s     0.445    13.8MB     2.22

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     4.7s     4.7s     0.213    25.5MB     1.70

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.62s    5.62s     0.178     286MB     1.96

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.3s    14.3s    0.0698     538MB     1.54

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    336ms    340ms      2.94     3.8MB        0

Suggestions

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