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
Publishing Basic Performance Metrics Would be Helpful #239
Comments
I also notice that json5 parser is much slow |
Well, however you do it, if you want to be successful I think you need to publish some metrics at some point. It's ok if JSON5 is slower, as long as: A) people know how much, so they can make an educated decision when adopting it, and B) you're working to make it faster :-) |
What is the use case for JSON5 to be comparable to JSON as far as performance? Keep in mind that JSON5 is JSON for Humans, not something to replace JSON. |
Here's a graph that I find rather compelling. TypeDoc is a documentation generator. It does quite a few things... but part of it's process is getting themes to highlight code blocks. The highlighter that we use (Shiki) uses json5 to load theme descriptions... this should really be a negligible amount of time in the documentation process, especially considering that TypeDoc runs its input through the TypeScript compiler, which does a lot more work. However, when benchmarking, 27% of TypeDoc's runtime is spent in json5, parsing themes. This really ought to be at most 3%, and probably even less than 1%, judging simply based on the amount of data that TypeScript consumes compared to json5. It looks like #233 should help significantly reduce this. JSON5 might have been intended for humans, but it is not only being used by humans. (The light blue Edit: I experimentally replaced JSON5 with jsonc-parser, since JSON5 specific features didn't seem to be used, this immediately cut down Shiki's parse time to 7.4%. Maybe 1% was too ambitious... but 27% is still way slower. |
One of the biggest arguments against adopting JSON5 would be that "it will make serializing/parsing meaningfully slower".
That argument could easily be eliminated (or at least contextualized) with some basic metrics. It would be so helpful if the website had even a single simple chart, which just showed the performance scaling of parsing/serializing a basic example (eg. the
package.json
of a popular library like Express or React), in both JSON5, and with native JSON.parse/stringify methods.If you could show other interesting details, like whether performance changes at all when you use JSON5 features (vs. just using it to parse JSON1), that'd be great too ...
... but really all that's needed for "MVP" status here is just any metrics, even extremely basic and simple ones.
The text was updated successfully, but these errors were encountered: