an R package for blazing fast parsing of JSON urls
The goal of furly is to combine the fast async curl downloads and the blazing fast JSON parsing of RcppSimdJso
You can install the development version of furly from Github:
devtools::install_github("melsiddieg/furly")
install.packages("furly")
This is a basic example which shows you how to solve a common problem:
library(furly)
url <- "https://bit.ly/cellbase1"
url2 <- "https://bit.ly/cellbase2"
url3 <- "https://bit.ly/cellbase3"
url4 <- "https://bit.ly/cellbase4"
urls <- c(url,url2,url3,url4)
res<-furly(urls)
bench <- microbenchmark::microbenchmark(
jsonlite= lapply(urls, function(x)jsonlite::fromJSON(x)),
RcppSimdJson = RcppSimdJson::fload(urls),
furly = furly(urls),times = 3
)
Unit: relative expr min lq mean median uq max neval jsonlite 5.543655 5.839211 4.736492 6.126533 4.45725 3.535009 3 RcppSimdJson 15.977387 18.850337 15.918384 21.643254 15.89797 12.723832 3 furly 1.000000 1.000000 1.000000 1.000000 1.00000 1.000000 3