Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
random: Use branchless implementation for mask generation in Randomiz…
…er::getBytesFromString() (#10522) * random: Add `max_offset` local to Randomizer::getBytesFromString() * random: Use branchless implementation for mask generation in Randomizer::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. * Improve comment for masking in Randomizer::getBytesFromString()
- Loading branch information
Showing
2 changed files
with
62 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters