tustvold opened a new issue, #3629: URL: https://github.com/apache/arrow-rs/issues/3629
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] (This section helps Arrow developers understand the context and *why* for this feature, in addition to the *what*) --> 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** <!-- A clear and concise description of what you want to happen. --> 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: 1. Uses [pshufb](https://www.felixcloutier.com/x86/pshufb) to implement a fast vectorised lookup table 2. Uses [clmulq](https://www.felixcloutier.com/x86/pclmulqdq) 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. **Describe alternatives you've considered** <!-- A clear and concise description of any alternative solutions or features you've considered. --> **Additional context** <!-- Add any other context or screenshots about the feature request here. --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
