Re:The cost of parsing JSON
by TwoNineA on Wednesday September 18, 2019 @11:04AM
(#21006145)
Does this apply to other JS engines or only V8?
[ Parent
| on HN ]
Look at the chart specifically:
> 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.
There is a graph on the article showing the other JS engines and yes, it parses faster.
Re:The cost of parsing JSON
by jakelazaroff on Wednesday September 18, 2019 @11:05AM
(#21006156)
> 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.
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...
ah I totally missed that! It's a link to their other benchmarks under the main graph; easy to miss: