Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster JSON parsing #583

Open
m-muecke opened this issue Nov 14, 2024 · 0 comments
Open

Faster JSON parsing #583

m-muecke opened this issue Nov 14, 2024 · 0 comments

Comments

@m-muecke
Copy link
Contributor

m-muecke commented Nov 14, 2024

Since the yyjsonr package is on CRAN now, I wanted to check the openess of having another option for parsing the JSON in req_body_json() with yyjsonr, since it seems to be quite a bit faster.

Quick benchmark:

str <- yyjsonr::write_json_str(iris)
bench::mark(
  jsonlite::fromJSON(str),
  yyjsonr::read_json_str(str)
)
#> # A tibble: 2 × 6
#>   expression                       min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr>                  <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 jsonlite::fromJSON(str)      284.5µs  298.6µs     3298.    1.29MB    16.5 
#> 2 yyjsonr::read_json_str(str)   26.9µs   27.9µs    34519.    9.69KB     3.45

Created on 2024-11-14 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant