-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Comparing changes
Open a pull request
base repository: php/php-src
base: 3b1918b
head repository: php/php-src
compare: 18a385f
- 13 commits
- 11 files changed
- 2 contributors
Commits on Jun 10, 2025
-
Fix GH-18820: Windows compilation issue: php-src\Zend\zend_exceptions…
….h(75): error C2122: 'message': prototype parameter in name list illegal INTERNAL_FUNCTION_PARAMETERS is defined in zend.h, but not included in zend_exceptions.h (and it shouldn't). Expand the macro to fix the compile issue.
Configuration menu - View commit details
-
Copy full SHA for 0a95b2f - Browse repository at this point
Copy the full SHA 0a95b2fView commit details -
Improve performance of unpack() with nameless repetitions (#18803)
We can avoid creating temporary strings, and then reparsing them into numbers with zend_symtable_update() by using zend_hash_index_update() directly. For the following benchmark on an i7-4790: ```php $file = str_repeat('A', 100000); for ($i=0;$i<100;$i++) unpack('C*',$file); ``` I get: ``` Benchmark 1: ./sapi/cli/php y.php Time (mean ± σ): 85.8 ms ± 1.8 ms [User: 74.5 ms, System: 10.4 ms] Range (min … max): 83.8 ms … 92.4 ms 33 runs Benchmark 2: ./sapi/cli/php_old y.php Time (mean ± σ): 318.3 ms ± 2.7 ms [User: 306.7 ms, System: 9.9 ms] Range (min … max): 314.9 ms … 321.6 ms 10 runs Summary ./sapi/cli/php y.php ran 3.71 ± 0.08 times faster than ./sapi/cli/php_old y.php ``` On an i7-1185G7 I get: ``` Benchmark 1: ./sapi/cli/php test.php Time (mean ± σ): 60.1 ms ± 0.7 ms [User: 47.8 ms, System: 12.0 ms] Range (min … max): 59.2 ms … 63.8 ms 48 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Benchmark 2: ./sapi/cli/php_old test.php Time (mean ± σ): 220.8 ms ± 2.2 ms [User: 209.6 ms, System: 10.7 ms] Range (min … max): 218.5 ms … 224.5 ms 13 runs Summary ./sapi/cli/php test.php ran 3.67 ± 0.06 times faster than ./sapi/cli/php_old test.php ```
Configuration menu - View commit details
-
Copy full SHA for 559858c - Browse repository at this point
Copy the full SHA 559858cView commit details -
Remove dead code from openssl_spki_new() implementation (#18752)
If s is not NULL, the length can't be <= 0 because we at least append `spkac` in the string, which is non-empty. I noticed this condition because if it were actually possible to execute, then it would leak memory.
Configuration menu - View commit details
-
Copy full SHA for dbabbe1 - Browse repository at this point
Copy the full SHA dbabbe1View commit details
Commits on Jun 12, 2025
-
ext/standard/pack: Inline constant single use variables
They serve no purpose and are just confusing
Configuration menu - View commit details
-
Copy full SHA for 2a77e28 - Browse repository at this point
Copy the full SHA 2a77e28View commit details -
ext/standard/pack: Remove useless casts
And use char instead of widening to int for no reason
Configuration menu - View commit details
-
Copy full SHA for e96a7f0 - Browse repository at this point
Copy the full SHA e96a7f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34e22c5 - Browse repository at this point
Copy the full SHA 34e22c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a297a44 - Browse repository at this point
Copy the full SHA a297a44View commit details -
Configuration menu - View commit details
-
Copy full SHA for def3a95 - Browse repository at this point
Copy the full SHA def3a95View commit details -
Simplify callers of zval_try_get_long() (#18830)
Since 2b38384 references are handled properly by the Zend API, so we can simplify the callers by removing reference handling from there.
Configuration menu - View commit details
-
Copy full SHA for 029a788 - Browse repository at this point
Copy the full SHA 029a788View commit details -
Use zend_string_release_ex() in concat_function() (#18827)
The strings we encounter are either interned in which case the persistent bool doesn't matter; or they're temporary as the code already assumes that anyway. This patch shrinks the function from 3332 bytes to 3173 bytes on x86-64 with GCC 15.1.1.
Configuration menu - View commit details
-
Copy full SHA for 28a083b - Browse repository at this point
Copy the full SHA 28a083bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 42b9b2f - Browse repository at this point
Copy the full SHA 42b9b2fView commit details -
Instead of using lookup tables, we can use a combination of shifts and byte swapping to achieve the same thing in less cycles and with less code. Benchmark files --------------- pack1.php: ```php for ($i = 0; $i < 10_000_000; ++$i) { pack("J", 0x7FFFFFFFFFFFFFFF); } ``` pack2.php: ```php for ($i = 0; $i < 4000000; ++$i) { pack("nvc*", 0x1234, 0x5678, 65, 66); } ``` On an i7-4790: ``` Benchmark 1: ./sapi/cli/php pack1.php Time (mean ± σ): 408.8 ms ± 3.4 ms [User: 406.1 ms, System: 1.6 ms] Range (min … max): 403.6 ms … 413.6 ms 10 runs Benchmark 2: ./sapi/cli/php_old pack1.php Time (mean ± σ): 451.7 ms ± 7.7 ms [User: 448.5 ms, System: 2.0 ms] Range (min … max): 442.8 ms … 461.2 ms 10 runs Summary ./sapi/cli/php pack1.php ran 1.11 ± 0.02 times faster than ./sapi/cli/php_old pack1.php Benchmark 1: ./sapi/cli/php pack2.php Time (mean ± σ): 239.3 ms ± 6.0 ms [User: 236.2 ms, System: 2.3 ms] Range (min … max): 233.2 ms … 256.8 ms 12 runs Benchmark 2: ./sapi/cli/php_old pack2.php Time (mean ± σ): 271.9 ms ± 3.3 ms [User: 269.7 ms, System: 1.3 ms] Range (min … max): 267.4 ms … 279.0 ms 11 runs Summary ./sapi/cli/php pack2.php ran 1.14 ± 0.03 times faster than ./sapi/cli/php_old pack2.php ``` On an i7-1185G7: ``` Benchmark 1: ./sapi/cli/php pack1.php Time (mean ± σ): 263.7 ms ± 1.8 ms [User: 262.6 ms, System: 0.9 ms] Range (min … max): 261.5 ms … 268.2 ms 11 runs Benchmark 2: ./sapi/cli/php_old pack1.php Time (mean ± σ): 303.3 ms ± 6.5 ms [User: 300.7 ms, System: 2.3 ms] Range (min … max): 297.4 ms … 318.1 ms 10 runs Summary ./sapi/cli/php pack1.php ran 1.15 ± 0.03 times faster than ./sapi/cli/php_old pack1.php Benchmark 1: ./sapi/cli/php pack2.php Time (mean ± σ): 156.7 ms ± 2.9 ms [User: 154.7 ms, System: 1.7 ms] Range (min … max): 151.6 ms … 164.7 ms 19 runs Benchmark 2: ./sapi/cli/php_old pack2.php Time (mean ± σ): 174.6 ms ± 3.3 ms [User: 171.9 ms, System: 2.3 ms] Range (min … max): 170.7 ms … 180.4 ms 17 runs Summary ./sapi/cli/php pack2.php ran 1.11 ± 0.03 times faster than ./sapi/cli/php_old pack2.php ``` Co-authored-by: divinity76@gmail.com
Configuration menu - View commit details
-
Copy full SHA for 836cda6 - Browse repository at this point
Copy the full SHA 836cda6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 18a385f - Browse repository at this point
Copy the full SHA 18a385fView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 3b1918b...18a385f