[php-src] PR #18513: optimize pack
| From: | divinity76 | Date: | Wed, 07 May 2025 01:59:48 +0000 |
| Subject: | [php-src] PR #18513: optimize pack | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-31641@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/18513
Author: divinity76
got rid of BASIC_MINIT_SUBMODULE(pack)
by moving a bunch of stuff from runtime-initialization to compile-time initialization.
```sh
hans@DESKTOP-EE15SLU:~/projects/php-src$ cat bench.php
<?php
for ($i = 0; $i < 10_000_000; ++$i) {
pack("J", 0x7FFFFFFFFFFFFFFF);
}
hans@DESKTOP-EE15SLU:~/projects/php-src$ hyperfine --warmup 10 --runs 100
'./sapi/cli/php-unoptimized ./bench.php' ; hyperfine --warmup 10 --runs 100
'./sapi/cli/php-optimized ./bench.php' ; Benchmark 1: ./sapi/cli/php-unoptimized
./bench.php
Time (mean ± σ): 261.7 ms ± 32.6 ms [User: 252.3 ms, System: 1.3 ms]
Range (min … max): 249.6 ms … 414.5 ms 100 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 1: ./sapi/cli/php-optimized ./bench.php
Time (mean ± σ): 259.4 ms ± 25.5 ms [User: 250.4 ms, System: 0.9 ms]
Range (min … max): 248.8 ms … 401.9 ms 100 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.
```
- don't have access to a quiet system
- don't have access to a big-endian system to test on. hopefully Github CI does.