memchr icon indicating copy to clipboard operation
memchr copied to clipboard

Support for lt/gt conditions

Open purplesyringa opened this issue 6 months ago • 1 comments

serde_json has a hot loop in string parsing that searches for a ", a \, or a control character (ASCII 0x00-0x1f). I've seen a speedup from the user of memchr for " and \, and I expect a similar speedup from a SIMD-based control character search routine.

The strategies memchr utilizes for equality comparison are quite generic, and I think they can be extended to signed/unsigned less-than/greater-than comparison as-is. I admit this would complicate the crate, but that'd save people from having to reinvent the wheel over and over.

Would you be willing to explore the possibility of bringing it to this crate or accepting PRs that do so?

purplesyringa avatar Jul 29 '24 08:07 purplesyringa