Work-in-progress: New #RStats JSON library

Early results on a microbenchmark look promising!

Fastest JSON parser for R?

Note: Benchmark is not indicative of real-world use cases. Performance gap narrows on larger examples. Benchmarking known to cause cancer in mice.

#SaturdayCoding

@coolbutuseless wow!! Wish I had these kinds of Saturdays. Keep us updated!

@coolbutuseless That is amazing!

Have you looking at writing R objects to json?

@emilhvitfeldt Yep.

Creating JSON from R objects looks promising as well.

#RStats

@coolbutuseless @emilhvitfeldt cool! I wonder how much of the time saved comes from allocation
@coolbutuseless awesome! I don't really work on this on a day-to-day, but this is an area I hear people complain
@coolbutuseless, out of curiosity, could you also include `rjson::toJSON()` and `jsonify::to_json()` in the test?

@coolbutuseless, it looks great!

CC: @josiah

@krzysztof_dyba @coolbutuseless holy smokes Batman. What wizardry is this? 2 questions: is there int64 support like RccpSimdJson? And is it possible to return NAs in data frames instead of NULL?

@josiah There's support for very little at the moment :)

int64 support is a possibility.

Could you give me an example of JSON NA/NULL data.frame issue? Is this something {jsonlite} doesn't do? But rcppsimdjson does?

@coolbutuseless See the example with iris at https://fosstodon.org/@coolbutuseless/110795041340566647

only RcppSimdJson has NA in the data

coolbutuseless (@[email protected])

Attached: 2 images Work-in-progress: New #RStats JSON library Early results on a microbenchmark look promising! Fastest JSON parser for R? Note: Benchmark is not indicative of real-world use cases. Performance gap narrows on larger examples. Benchmarking known to cause cancer in mice. #SaturdayCoding

Fosstodon

@josiah thanks for clarifying!

Definitely possible.

Currently thinking of all the config options needed to handle everyone's needs.

@coolbutuseless @emilhvitfeldt wow, that does indeed look promising. Are there plans for it to eventually make it to CRAN? This could speed up {mapview} et al. quite a bit (using jsonify ATM).

@tim_salabim Cran eventually. Still quite a bit to go from this proof-of-concept.

Is there anything in your current use of jsonify that you'd like to change if you could? Na/null handling in your common cases that don't work well? Structures that don't get passed the way you'd like?

@coolbutuseless I'll take a look but don't think so. jsonify was made out of a very similar need to what mapview needs

@tim_salabim If nothing springs to mind, then that's probably a good thing!

What were the reasons you went with jsonify instead of jsonlite? Speed? Linking directly at the C-level? something else?

@coolbutuseless simply speed for passing the data from R to JS to be mapped
@coolbutuseless whoah incredible flex. Bravo.
@milesmcbain @coolbutuseless yeah but a bit irresponsible to add to the mouse cancer burden…