Created
February 23, 2018 03:50
-
-
Save MichaelChirico/63ae2e4cf87079d9a45b7fb17082820e to your computer and use it in GitHub Desktop.
script to install a given commit of data.table & run a speed test of fread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(devtools) | |
install_github('Rdatatable/data.table', quiet = TRUE, | |
ref = commandArgs(trailingOnly = TRUE)) | |
library(data.table) | |
f = list.files('.', recursive = TRUE, pattern = '\\.csv$', full.names = TRUE) | |
ts = replicate(5L, { | |
t0 = Sys.time() | |
invisible(lapply(f, fread)) | |
as.double(Sys.time() - t0) | |
}) | |
cat(paste(ts, collapse = ',')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One possible improvement would to create a local library for each commit and then point to that directory. The advantage being that you only need to install once per commit. (So if you choose to profile a different script you can just change the script without reinstalling.)