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

Consider using slow-json-stringify #108

Open
stephenh opened this issue Feb 12, 2021 · 4 comments
Open

Consider using slow-json-stringify #108

stephenh opened this issue Feb 12, 2021 · 4 comments

Comments

@stephenh
Copy link

stephenh commented Feb 12, 2021

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.

@hoangvvo
Copy link
Contributor

hoangvvo commented Mar 7, 2021

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: #88

@negezor
Copy link

negezor commented Nov 15, 2021

@hoangvvo do you have plans to develop PR? Or is there something I can help you with?

@hoangvvo
Copy link
Contributor

@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)

@stephenh
Copy link
Author

@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.

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

3 participants