Skip to content

Speeding up DOM parsing? #2129

Answered by jkeiser
DUOLabs333 asked this question in Q&A
Feb 12, 2024 · 1 comments · 12 replies
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@lemire
Comment options

@lemire
Comment options

@DUOLabs333
Comment options

@jkeiser
Comment options

Answer selected by DUOLabs333
@DUOLabs333
Comment options

@DUOLabs333
Comment options

@DUOLabs333
Comment options

@lemire
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants