Created
January 26, 2019 04:31
-
-
Save stufield/d2f68da45da816ea316feb9bca57d520 to your computer and use it in GitHub Desktop.
Quick comparison of file seriation via feather vs base functionality
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
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