2 ms·
So you're suggesting to write a tailored JSON parser for each use case? Sounds convincing over my preferred approach...
by rhabarba 7y ago
So you're suggesting to write a tailored JSON parser for each use case? Sounds convincing over my preferred approach...
- lloeki 7y agoNot for each use case of everything, anywhere, of course. This specific use case is important enough to warrant a dedicated parser though, and has benefits both in performance and in security. People have ben actively doing this for XML with streaming parsers that emit events, where you don't just validate XML itself but the semantics of the payload you're receiving, and bail out early instead of parsing the whole XML into a DOM then validating the DOM structure and values.