The cost of parsing JSON
v8.dev
The cost of parsing JSON
1–10 of 308 posts
Re: The cost of parsing JSON
#2Re: The cost of parsing JSON
#3Re: The cost of parsing JSON
#4Does this apply to other JS engines or only V8?
Re: The cost of parsing JSON
#5Does this apply to other JS engines or only V8?
Re: The cost of parsing JSON
#6Does this apply to other JS engines or only V8?
> JSON.parse('…') is much faster to parse, compile, and execute compared to an equivalent JavaScript literal — not just in V8 (1.7× as fast), but in all major JavaScript engines.
Re: The cost of parsing JSON
#7Does this apply to other JS engines or only V8?
Re: The cost of parsing JSON
#8Re: The cost of parsing JSON
#9Title correction: it's faster to parse and initialize using JSON than to parse and compile the code required to initialize Objects directly. If the code is already compiled, it's much faster to initialize in code. At least that's my understanding of the linked article.
> As long as the JSON string is only evaluated once, the JSON.parse approach is much faster compared to the JavaScript object literal, especially for cold loads.
Re: The cost of parsing JSON
#10Earlier quoted context omitted.
I was wondering that too. No mention of Firefox or Safari. There is more than one browser/render engine out there. Don't design for the monoculture.
JavascriptCore, Chakra and Spidermonkey appear in the benchmark...