Skip to content

Commit

Permalink
adds benchmark code for data frame functions (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed Jan 18, 2025
1 parent 58a8671 commit d383219
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
^cran-comments\.md$
^CRAN-SUBMISSION$
^revdep$
^bench$
32 changes: 32 additions & 0 deletions bench/data-frame.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
devtools::load_all(here::here())
library(ggplot2)
library(bench)

print(mark(
dataframe(), # same as quick_df(NULL)
quick_df(),
quick_df(list()),

data.frame(),
data.frame(NULL),
data.frame(list())
))

autoplot(.Last.value)

print(mark(
dataframe(a = integer(), b = character(), ),
data.frame(a = integer(), b = character())
))

autoplot(.Last.value)

local({
c <- b <- a <- seq_len(100)
print(mark(
dataframe(a = a, b = b, c = c, ),
data.frame(a = a, b = b, c = c)
))
})

autoplot(.Last.value)

0 comments on commit d383219

Please sign in to comment.