Skip to content

Instantly share code, notes, and snippets.

@stufield
Created January 26, 2019 04:31
Show Gist options
  • Save stufield/d2f68da45da816ea316feb9bca57d520 to your computer and use it in GitHub Desktop.
Save stufield/d2f68da45da816ea316feb9bca57d520 to your computer and use it in GitHub Desktop.
Quick comparison of file seriation via feather vs base functionality
reprex::reprex({
library(magrittr)
library(SomaObjects)
library(tibble)
library(feather)
t_feather <- purrr::map_dbl(1:10, ~ {
t <- Sys.time()
write_feather(SurvData, "/tmp/surv.feather")
as.numeric(Sys.time() - t)
}) %>% mean()
t_base <- purrr::map_dbl(1:10, ~ {
t <- Sys.time()
saveRDS(SurvData, file = "/tmp/surv.rds")
as.numeric(Sys.time() - t)
}) %>% mean()
s_feather <- file.info("/tmp/surv.feather")$size / 1024^2
s_base <- file.info("/tmp/surv.rds")$size / 1024^2
tibble(
package = c("base", "feather"),
avg_time = c(t_base, t_feather),
size = c(s_base, s_feather)
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment