3 ms·
The point is that the JSON parser runs in the browser - as native code - so it's rather difficult to match it's performance with some other parser in JS, even i
by dom0 10y ago
The point is that the JSON parser runs in the browser - as native code - so it's rather difficult to match it's performance with some other parser in JS, even if that one has an easier job to do.
- bzbarsky 10y agoIt may be hard to match the performance of the parsing per se. But the typical data flow with JSON goes like this: 1) Get a string. 2) JSON.parse it into an object graph. 3) Use that object graph to build the data structure you really care about (e.g. a DOM). If you parse yourself you may be able to cut out the middleman object graph. That might be worthwhile; needs measuring.