Created
June 18, 2019 02:46
-
-
Save kippjohnson/7c159c98c4e273577c96a1da06066d64 to your computer and use it in GitHub Desktop.
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
> rm(list=ls()) | |
> set.seed(123) | |
> library(data.table) | |
> library(feather) | |
> library(tidyverse) | |
> dsize=1e7 | |
> nc <- 100 | |
> x <- data.frame(matrix(rnorm(dsize), ncol=nc)) | |
> ### | |
> ### write.table | |
> ### | |
> system.time({ | |
> + write.table(x, file = “~/Desktop/tmp.txt”) | |
> + y <- read.table(file=“~/Desktop/tmp.txt”) | |
> + }) | |
user system elapsed | |
32.338 1.663 34.348 | |
> ### | |
> ### tidyverse | |
> ### | |
> system.time({ | |
> + write_tsv(x, path=“~/Desktop/tmp.txt”) | |
> + y <- read_tsv(file=“~/Desktop/tmp.txt”) | |
> + }) | |
user system elapsed | |
4.707 0.587 5.356 | |
> ### | |
> ### RDS | |
> ### | |
> system.time({ | |
> + saveRDS(x, file=“~/Desktop/tmp.RDS”) | |
> + y <- readRDS(file=“~/Desktop/tmp.RDS”) | |
> + }) | |
user system elapsed | |
4.156 0.191 4.438 | |
> ### | |
> ### data.table | |
> ### | |
> system.time({ | |
> + fwrite(x, file = “~/Desktop/tmp.txt”) | |
> + y <- fread(file=“~/Desktop/tmp.txt”) | |
> + }) | |
user system elapsed | |
1.754 0.180 1.967 | |
> ### | |
> ### feather | |
> ### | |
> system.time({ | |
> + write_feather(x, path=“~/Desktop/tmp.feather”) | |
> + y <- read_feather(path=“~/Desktop/tmp.feather”) | |
> + }) | |
user system elapsed | |
0.090 0.091 0.190 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment