In node/V8, from what I understand, JSON.parse is already delegated to another language, it's in (fairly) optimized C++ code. What you're seeing in that benchmark (when comparing "C++" and "Javascript Node") is less the expense of parsing JSON and more the expense of creating heavy-weight, garbage collected, etc, Javascript objects, compared to much more light-weight native objects (which couldn't possibly be used by Javascript code, as they need to be wrapped in relatively expensive layers to be exposed). If you look at an actual pure-Javascript JSON parser (e.g. json5), it's performance is going to be even worse =).
This does mean, however, if you're getting a bunch of JSON data, and distilling it into a relatively small amount of data, you may get a pretty significant speed-up by doing that in a native module (big JSON -> big native structure -> small JS structure instead of big JSON -> big JS structure -> small JS structure). Of course, that's true of *any* data processing in node (or any interpreted language) - moving the CPU-intensive heavily lifting to optimized native code will give you a boost, it's just usually not worth the complexity of doing so.
On Wednesday, May 27, 2015 at 4:50:30 AM UTC-7, Alisson Cavalcante Agiani wrote: