4 ms·
Pest. The Elegant Parser
- dathinab 6y agoI remember a while ago pest became strongly criticized for using flawed benchmarks to show how it's the fastest (the benchmarks where doing fundamentally different things). Does anyone know if that is still the case? UPDATE: Looking at their benchmarks they do only tokenize the json but do not fully parse it, i.e. they don't: - parse numbers, bool, int, float - unescape strings (requires more alloc) - create a map type for objects (requires more alloc) And while idk. if there nom bench they used also only tokenizes (the (repo:)nom/json.rs bench do not just tokenize) the serde one definitely does all the parsing producing a high level json representing (i.e. an enum with different variants using `Vec` for array and `HashMap` for objects, where numbers, boolenas and strings are converted to respective rust types) so they are comparing code which currently only validates+toenzies syntax with code which fully parses the JSON and as such has to do a bunch of additional steps and memory allocation. It's really sad that a it project with so much work put into it still uses dishonest means to promote itself (I mean it's unnecessary, it fast and it's a parser generator so no annoying hand rolling code, that makes it already a very reasonable choice even without being faster then nom).