You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The TapeDecoder added in #3479 is fairly naive, in that it performs a scan of the input stream and uses the encountered bytes to directly drive its state machine. Broadly speaking this leads to an unpredictable branch on every input byte. This is not ideal, and severely limits throughput.
Describe the solution you'd like
https://arxiv.org/pdf/1902.08318.pdf describes a two stage approach, as used by simdjson, to efficiently compute the structural indices ahead of time. That is the start and end positions of all atoms, objects and arrays. This allows the parsing state machine to very efficiently produce the parsed tape.
We should do something similar, unfortunately the approach as described in the paper relies on two tricks:
Uses pshufb to implement a fast vectorised lookup table
Uses clmulq to implement fast "quote mask filling"
Fortunately both of these have stable intrinsics in std::arch that we can use, although this will require some target-feature shenanigans.
Activity