Skip to content

Instantly share code, notes, and snippets.

@hypebright
Last active July 11, 2022 04:36
Show Gist options
  • Save hypebright/2183df568ccc0d47b8e961268592264a to your computer and use it in GitHub Desktop.
Save hypebright/2183df568ccc0d47b8e961268592264a to your computer and use it in GitHub Desktop.
Microbenchmark to compare reading times for a .csv file in R
library(microbenchmark)
library(data.table)
library(readr)
library(vroom)
library(iotools)
myfile <- 'mypath.csv'
microbenchmark(read.csv(myfile),
data.table::fread(myfile),
readr::read_csv(myfile),
vroom::vroom(myfile),
iotools::read.csv.raw(myfile),
times = 10L
)
@hypebright
Copy link
Author

Results for a 50MB .csv file on my machine:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment