php-src/main
Ilija Tovilo 2f5295692f
Optimize stripos/stristr
Closes GH-7847
Closes GH-7852

Previously stripos/stristr would lowercase both the haystack and the
needle to reuse strpos. The approach in this PR is similar to strpos.
memchr is highly optimized so we're using it to search for the first
character of the needle in the haystack. If we find it we compare the
remaining characters of the needle manually.

The new implementation seems to perform about half as well as strpos (as
two memchr calls are necessary to find the next candidate).
2022-01-31 21:44:31 +01:00
..
streams Merge branch 'PHP-8.1' 2021-11-29 14:50:54 +01:00
alloca.c Fix spelling and grammar mistakes 2021-04-13 12:09:37 +02:00
build-defs.h.in Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
explicit_bzero.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
fastcgi.c Return value from ZEND_ATOL 2021-07-12 16:51:24 +02:00
fastcgi.h Mark various functions with void arguments. 2021-05-12 14:55:53 +01:00
fopen_wrappers.c Fix for bug in file handling refactor. 2021-11-23 18:34:48 +01:00
fopen_wrappers.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
getopt.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
http_status_codes.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
internal_functions_win32.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
internal_functions.c.in Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
main.c Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default 2021-12-05 21:03:27 +01:00
network.c Fix 'can not' in test data and in code comments 2021-10-05 09:51:58 +01:00
output.c Use more compact representation for packed arrays. 2021-11-03 15:18:26 +03:00
php_compat.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_content_types.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_content_types.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_getopt.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_globals.h Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-10 19:26:33 +02:00
php_ini.c Merge branch 'PHP-8.1' 2022-01-18 14:50:29 +01:00
php_ini.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_main.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_memory_streams.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_network.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_open_temporary_file.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_open_temporary_file.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_output.h Remove unnecessary PHP_FUNCTION() declarations (#7472) 2021-09-07 10:04:00 +02:00
php_reentrancy.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_scandir.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_scandir.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_stdint.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_streams.h Use more specific return type for stream functions 2021-09-20 14:24:59 +01:00
php_syslog.c Make syslog() binary safe 2021-07-15 19:08:26 +02:00
php_syslog.h Make syslog() binary safe 2021-07-15 19:08:26 +02:00
php_ticks.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
php_ticks.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_variables.c Merge branch 'PHP-8.0' into PHP-8.1 2022-01-17 23:45:49 +01:00
php_variables.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_version.h Preparing for 8.1.3-dev 2022-01-04 19:29:41 +01:00
php.h Optimize stripos/stristr 2022-01-31 21:44:31 +01:00
reentrancy.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
rfc1867.c Use more compact representation for packed arrays. 2021-11-03 15:18:26 +03:00
rfc1867.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
SAPI.c Allow get_request_time() hook to fail 2021-09-16 16:54:07 +02:00
SAPI.h Allow get_request_time() hook to fail 2021-09-16 16:54:07 +02:00
snprintf.c Use memrchr() when available 2021-11-24 16:13:34 +03:00
snprintf.h Remove FORMAT_CONV_MAX_PRECISION 2021-08-02 15:59:26 +02:00
spprintf.c Use memrchr() when available 2021-11-24 16:13:34 +03:00
spprintf.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
strlcat.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
strlcpy.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00