1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 10:03:18 +02:00
Files
archived-php-src/ext/standard
Alex Dowad 0b7986f976 Tweak SSE2-accelerated strtoupper() and strtolower() for speed
I learned this trick for doing a faster bounds check with both upper
and lower bounds by reading a disassembler listing of optimized code
produced by GCC; instead of doing 2 compares to check the upper and the
lower bound, add an immediate value to shift the range you are testing
for to the far low or high end of the range of possible values for the
type in question, and then a single compare will do. Intstead of
compare + compare + AND, you just do ADD + compare.

From microbenchmarking on my development PC, this makes strtoupper()
about 10% faster on long strings (~10,000 bytes).
2023-01-20 08:21:45 +02:00
..
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2022-07-19 10:27:38 +01:00
2022-08-09 16:22:14 +02:00
2022-07-19 17:45:15 +02:00
2021-05-06 12:16:35 +02:00
2021-08-19 10:39:23 +02:00
2022-11-28 17:12:07 +01:00
2021-08-19 10:39:23 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:54:35 +00:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2022-08-18 12:31:56 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2023-01-16 12:25:59 +01:00
2023-01-16 12:25:59 +01:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2022-07-19 10:27:38 +01:00
2022-07-19 10:27:38 +01:00
2022-07-19 10:27:38 +01:00
2022-07-19 10:27:38 +01:00
2022-07-19 10:27:38 +01:00
2023-01-16 12:27:33 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2023-01-15 15:43:57 +00:00
2022-07-19 10:27:38 +01:00
2021-05-06 12:16:35 +02:00
2023-01-16 12:27:33 +01:00
2023-01-16 12:27:33 +01:00