Skip to content

Instantly share code, notes, and snippets.

@Keiku
Created January 12, 2017 08:17
Show Gist options
  • Save Keiku/c58558e9ad1195ed22669a37a87635f6 to your computer and use it in GitHub Desktop.
Save Keiku/c58558e9ad1195ed22669a37a87635f6 to your computer and use it in GitHub Desktop.
Serialization benchmark.
library(readr)
library(data.table)
library(feather)
object.size(df)
# 1654613472 bytes
system.time(write_csv(df, "df_write_csv.csv"))
# ユーザ システム 経過
# 160.540 29.079 200.667
system.time(fwrite(df, "df_fwrite.csv"))
# ユーザ システム 経過
# 6.735 10.936 19.744
system.time(saveRDS(df, "df.RData"))
# ユーザ システム 経過
# 85.359 4.097 91.849
system.time(write_feather(df, "df.feather"))
# ユーザ システム 経過
# 3.101 3.721 12.146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment