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

JS object literals slower than JSON.parse() #2

Open
tigt opened this issue Aug 8, 2019 · 0 comments
Open

JS object literals slower than JSON.parse() #2

tigt opened this issue Aug 8, 2019 · 0 comments

Comments

@tigt
Copy link

tigt commented Aug 8, 2019

The cost of JavaScript in 2019 § The cost of parsing JSON:

Because the JSON grammar is much simpler than JavaScript’s grammar, JSON can be parsed more efficiently than JavaScript. This knowledge can be applied to improve start-up performance for web apps that ship large JSON-like configuration object literals (such as inline Redux stores).

It then backs that up with some data.

If this is true, this package may be able to lose some bundle size by no longer supporting the JS-literal option — or at least making it tree-shakeable when unused.

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