ext/spl: Optimize php_spl_object_hash performance#22087
Conversation
After c1c6520, libgd needs PNG support to pass this test. Skip the test if we are using (external) libgd without it. close phpGH-22016
|
Is this really a hot path in "normal" code? It might be because people use |
|
I think, this improves WordPress hook performance. |
|
could WP use |
|
I think thats no longer true. lately they recommend PHP 8.3+ |
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
|
Guzzle use this function |
|
IMO |
| } | ||
|
|
||
| p = zend_mempcpy(p, "000000000000000", 16); | ||
| *p++ = '\0'; |
If WP uses this, then it makes sense to optimize it. |
|
WP is upgrading to |
Optimize php_spl_object_hash performance
Output:
Benchmark 1: ./sapi/cli/php_old -dopcache.enable_cli=0 bench.php Time (mean ± σ): 411.7 ms ± 2.3 ms [User: 407.7 ms, System: 2.8 ms] Range (min … max): 407.7 ms … 416.5 ms 10 runs Benchmark 2: ./sapi/cli/php -dopcache.enable_cli=0 bench.php Time (mean ± σ): 246.0 ms ± 1.6 ms [User: 243.0 ms, System: 2.1 ms] Range (min … max): 243.9 ms … 249.0 ms 12 runs Summary ./sapi/cli/php -dopcache.enable_cli=0 bench.php ran 1.67 ± 0.01 times faster than ./sapi/cli/php_old -dopcache.enable_cli=0 bench.php