1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/mbstring/tests
Alex Dowad b4cbaabd9b Add fast SSE2-based implementation of mb_strlen for known-valid UTF-8 strings
One small piece of this was obtained from Stack Overflow. According to
Stack Overflow's Terms of Service, all user-contributed code on SO is
provided under a Creative Commons license. I believe this license is
compatible with the code being included in PHP.

Benchmarking results (UTF-8 only, for strings which have already been
checked using mb_check_encoding):

For very short (0-5 byte) strings, mb_strlen is 12% faster.
The speedup gets greater and greater on longer input strings; for
strings around 100KB, mb_strlen is 23 times faster.

Currently the 'fast' code is gated behind a GC flag check which ensures
it is only used on strings which have already been checked for UTF-8
validity. This is because the accelerated code will return different
results on some invalid UTF-8 strings.
2023-01-09 07:50:40 +02:00
..
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-08-11 14:03:18 +02:00
2020-02-03 22:52:20 +01:00
2022-05-06 15:41:10 +02:00
2023-01-06 14:34:10 +02:00