ajschumacher / rjstat

read and write JSON-stat with R
Other
31 stars 6 forks source link

Faster implementation #2

Closed hmalmedal closed 10 years ago

hmalmedal commented 10 years ago

I tried your package on a large dataset and it took over a minute. I re-implemented it and got the time down to half a second.

txt <- readLines("http://data.ssb.no/api/v0/dataset/85436.json?lang=en", warn = F)
devtools::install_github("ajschumacher/rjstat", quiet = T)
## Installing github repo rjstat/master from ajschumacher
## Downloading master.zip from https://github.com/ajschumacher/rjstat/archive/master.zip
## arguments 'minimized' and 'invisible' are for Windows only
library("rjstat")
system.time(fromJSONstat(txt))
##    user  system elapsed 
##  72.529   0.731  73.336
detach("package:rjstat", unload = T)
devtools::install_github("hmalmedal/rjstat", quiet = T)
## Installing github repo rjstat/master from hmalmedal
## Downloading master.zip from https://github.com/hmalmedal/rjstat/archive/master.zip
## arguments 'minimized' and 'invisible' are for Windows only
library("rjstat")
system.time(fromJSONstat(txt))
##    user  system elapsed 
##   0.441   0.006   0.447
ajschumacher commented 10 years ago

This is great! Thank you!