1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext
Tim Düsterhus 31e2d2b86c random: Optimize Randomizer::getBytes() (#15228)
This patch greatly improves the performance for the common case of using a
64-bit engine and requesting a length that is a multiple of 8.

It does so by providing a fast path that will just `memcpy()` (which will be
optimized out) the returned uint64_t directly into the output buffer,
byteswapping it for big endian architectures.

The existing byte-wise copying logic was mostly left alone. It only received an
optimization of the shifting and masking that was previously applied to
`Randomizer::getBytesFromString()` in 1fc2ddc996.

Co-authored-by: Saki Takamachi <saki@php.net>
2024-08-05 19:12:29 +02:00
..
2024-08-05 16:15:19 +02:00
2024-08-05 16:23:38 +02:00
2024-08-03 09:47:39 +02:00
2024-08-03 09:47:39 +02:00
2024-08-03 09:47:39 +02:00