Hi team,
Following the migration and focus on jiter as the core parser for Pydantic, I've been auditing the source (specifically crates/jiter/src/parse.rs around line 257) for potential throughput gains.
I noticed that eat_whitespace and structural scanning (e.g., in array_step and object_step) are currently implemented as scalar loops (while let Some(next) = self.data.get(self.index)). While jiter is already high-performing, these byte-by-byte checks can become a significant bottleneck for payloads with large arrays or substantial indentation.
I’m proposing a targeted SIMD-accelerated 'fast-path' for whitespace/structural skipping. By using platform-specific vectorized masks (e.g., _mm256_movemask_epi8 on x86 or NEON equivalents), we could potentially skip up to 32 bytes of padding/whitespace per cycle without changing the existing iterator architecture.
I have a prototype showing a measurable throughput increase on minified/large datasets. Would you be open to a PR that introduces optional SIMD structural scanning for jiter?
Looking forward to your thoughts!
Hi team,
Following the migration and focus on
jiteras the core parser for Pydantic, I've been auditing the source (specificallycrates/jiter/src/parse.rsaround line 257) for potential throughput gains.I noticed that
eat_whitespaceand structural scanning (e.g., inarray_stepandobject_step) are currently implemented as scalar loops (while let Some(next) = self.data.get(self.index)). Whilejiteris already high-performing, these byte-by-byte checks can become a significant bottleneck for payloads with large arrays or substantial indentation.I’m proposing a targeted SIMD-accelerated 'fast-path' for whitespace/structural skipping. By using platform-specific vectorized masks (e.g.,
_mm256_movemask_epi8on x86 or NEON equivalents), we could potentially skip up to 32 bytes of padding/whitespace per cycle without changing the existing iterator architecture.I have a prototype showing a measurable throughput increase on minified/large datasets. Would you be open to a PR that introduces optional SIMD structural scanning for
jiter?Looking forward to your thoughts!