Skip to content

Speed up String encoding on CPUs without SIMD hardware support #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

radiospiel
Copy link
Contributor

This PR tests for the presence of characters to be escaped using SIMD with non-hardware-supported instructions. We are testing 8 chars in one round, following a code excerpt from https://lemire.me/blog/2025/04/13/detect-control-characters-quotes-and-backslashes-efficiently-using-swar/

For strings that don't require escapes I have seen speedups of around 15% with this change.

@radiospiel radiospiel changed the title Speed up String encoding for non-SSE and NEON CPUs Speed up String encoding on CPUs without SIMD hardware support May 31, 2025
@radiospiel
Copy link
Contributor Author

sry, pushed the wrong branch :(

@radiospiel radiospiel closed this May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant