graphql-jit
graphql-jit copied to clipboard
Consider using slow-json-stringify
I came across slow-json-stringify recently (via just-js using it, plus a lot of other optimizations, to get a high ranking on benchmarks), which has ~generally ~150-200% faster benchmarks over fast-json-stringify:
https://github.com/lucagez/slow-json-stringify/blob/master/benchmark.md
It requires the same setup as fast-json-stringify, of providing it a schema, albeit its own bespoke schema instead of a json schema.
But seems like this would be useful to try.
I think a better way moving forward is to have this as a separate package. To do so, we would need an API to allow custom stringify integration, which I am trying to achieve here: https://github.com/zalando-incubator/graphql-jit/pull/88
@hoangvvo do you have plans to develop PR? Or is there something I can help you with?
@hoangvvo do you have plans to develop PR? Or is there something I can help you with?
@negezor Thanks for the offer. I actually already have the PR merged to my fork at https://github.com/hoangvvo/graphql-jit.
Creating the PR should be trivial. It matters more whether there would an intent to merge it into this project (since it is possible that this is not their use cases or the current fast-json-stringify implementation is being used by some people)
@hoangvvo do you have any numbers about how much faster slow-json-stringify
was specifically for your project or on a graphql-jit benchmark?
Just thinking that, per your wondering if a PR for graphql-jit would be accepted, that having graphql-jit-specific benchmarks showing what a specific increase was, would hopefully pique the interest of the maintainers.