1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 17:13:31 +02:00
Files
archived-php-src/ext
Alex Dowad 63c50cc87e Add AVX2-accelerated version of mb_check_encoding for UTF-8 only
From some local benchmarks which I ran, the AVX2-based version is about
2.8x faster than the SSE2-based version on long (~10,000 byte) strings,
1.6x faster on medium (~100 byte) strings, and just about the same
on very short strings.

I followed the example of the code in the 'standard' module, using
preprocessor directives so that the code can be compiled in any of
4 ways:

1) With no AVX2 support at all (for example, when PHP is compiled for
   CPU architectures other than AMD64)
2) For CPUs with AVX2 only (for example, when PHP is built with
   CCFLAGS='-march=native' on a host which implements AVX2)
3) With runtime detection of AVX2 performed by the dynamic linker;
   this requires a dynamic linker which supports the STT_GNU_IFUNC
   symbol type extension to the ELF binary standard. This is true of
   glibc's dynamic linker, as of late 2009.
4) With runtime detection of AVX2 performed by the module init function.
   The detection is done by checking the output of CPUID and then a
   function pointer is set accordingly. In this case, all calls to the
   UTF-8 validation routine are indirect calls through that
   function pointer.
2023-01-26 09:49:58 +02:00
..
2022-10-27 14:42:17 +01:00
2023-01-25 10:50:32 +00:00
2023-01-23 13:46:58 +00:00
2022-09-07 17:41:10 +02:00
2023-01-23 13:46:58 +00:00
2023-01-24 09:15:44 +03:00
2022-10-27 14:42:40 +01:00
2023-01-23 13:46:58 +00:00
2023-01-16 12:27:33 +01:00
2022-09-06 10:42:34 +01:00
2023-01-25 12:10:19 +03:00
2023-01-23 13:51:26 +00:00
2022-11-30 12:13:36 +01:00
2022-10-19 11:37:30 +02:00
2023-01-16 12:27:33 +01:00
2022-12-19 16:17:02 +01:00
2023-01-23 17:49:34 +00:00
2023-01-16 12:27:33 +01:00
2022-09-07 17:41:10 +02:00
2023-01-23 13:46:58 +00:00
2023-01-19 09:06:39 +01:00
2023-01-25 00:12:32 +00:00
2022-10-27 14:42:40 +01:00
2023-01-15 15:43:57 +00:00