Speeding up DOM parsing? #2129
-
Using the DOM api, simdjson takes up 20% of runtime (I got this statistic from the perf profiler) from stage1 and stage2. Here's the line I use for parsing: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
I don't think that you are providing enough details. However, if, as you say, simdjson takes up only 20% of the running time of your application, then your main bottleneck is elsewhere, and that's elsewhere you must look. That is, if simdjson accounts for 20% of the running time, even if we made simdjson infinitely faster, you'd only gain 20% in speed. |
Beta Was this translation helpful? Give feedback.
I do think "entire JSON parser takes 20%" and "hash function takes 15%" is not comparing apples and oranges :) At the bare minimum, a parser necessarily has to scan every single character in the file, while the hash function only needs to scan the characters in the keys. In practice you likely need the parser to do a lot of other work to do beyond just scanning--deserializing numbers, interpreting escape codes in strings, validation, and and keeping track of JSON structure at an absolute minimum. None of that can be eliminated without a cost in functionality, and all of it comes at a runtime cost.
Not that simdjson can't be sped up--I'm sure there are savings to be had--but it has been ex…