walkerke / mapboxapi

R interface to Mapbox web services
https://walker-data.com/mapboxapi/
Other
110 stars 8 forks source link

Consider using RcppSimdJson, jsonify, or yyjsonr instead of jsonlite #48

Open JosiahParry opened 6 months ago

JosiahParry commented 6 months ago

I noticed that you are using jsonlite::fromJSON to parse fairly large results. From personal experience and benchmarks, jsonlite is one of the slowest packages available for this task. If performance is a goal of this package, I would consider exploring the packages RcppSimdJson & yyjsonr for parsing JSON and jsonify for making json. Simply replacing jsonlite with those dependencies can result in a massive speed up of your code.

walkerke commented 6 months ago

Appreciate the suggestion! I think that's something to consider if I find the time. We explored that a few months ago (see https://github.com/walkerke/mapboxapi/issues/39) but it led to breakages in the code, so I ended up tabling that for the time being.