Skip to content

random: Use branchless implementation for mask generation in Randomizer::getBytesFromString() #10522

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

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

TimWolla
Copy link
Member

@TimWolla TimWolla commented Feb 6, 2023

…er::getBytesFromString()

This was benchmarked against clzl with a standalone script with random inputs
and is slightly faster. clzl requires an additional branch to handle the
source_length = 1 / max_offset = 0 case.
@TimWolla TimWolla merged commit 0cfc45b into php:master Feb 8, 2023
@TimWolla TimWolla deleted the randomizer-getbytesfromstring-mask branch February 8, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants