ext/spl: Optimize php_spl_object_hash performance#22087
Open
arshidkv12 wants to merge 4 commits into
Open
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
Member
|
Is this really a hot path in "normal" code? It might be because people use |
Contributor
Author
|
I think, this improves WordPress hook performance. |
Contributor
|
could WP use |
Contributor
Author
|
Contributor
I think thats no longer true. lately they recommend PHP 8.3+ |
TimWolla
reviewed
May 19, 2026
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
|
Guzzle use this function |
Contributor
|
IMO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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