3 ms·
JSON.parse() is required to return a concrete JS value [1]. Most, if not all, C/C++ JSON parsers designed for performance don't build the value unless requested
by lifthrasiir 6y ago
JSON.parse() is required to return a concrete JS value [1]. Most, if not all, C/C++ JSON parsers designed for performance don't build the value unless requested. So whether to switch indeed depends on your use case, but for the different reason: if you use the majority of the parsed JSON your performance would be rather bound by object creation speed instead of parsing speed.
[1] It might be the case that modern benchmark-obsessed JS engines defer JSON parsing in this case though, in which case you definitely should not switch to simdjson.
- rattray 6y agoThat is the case with this library as well: https://github.com/luizperes/simdjson_nodejs/issues/5 https://github.com/luizperes/simdjson_nodejs/issues/5