Fix detection of unknown gcc function attributes
- LP: #1882279
- https://github.com/php/php-src/pull/8483
As discussed in [1], and old, buggy gcc macro have been hindering the php build configuration step, resulting in a binary which cannot make use of some performance improvements introduced to php upstream.
The observe performance difference between the upstream binaries shipped in docker.io/php showed these upstream binaries may perform some operations up to 10x faster than the downstream versions in x86_64-v{2,3,4} machines.
The patch proposed here fixes the embedded gcc macro so the binary can be built leveraging the gcc function attributes that provide such performance boosts.
[1] https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1882279/comments/9
Merge request reports
Activity
As discussed in https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1882279/comments/9,
It would be nice to test these patch in pre pentium4 i386 CPUs to ensure there will be no regressions introduced in case the builder does provide sse2 capabilities.
i386 tests performed in the following fashion:
- Deployed a Debian stable i386 VM and upgraded it to Debian testing (which contains php 8.1);
- Ensured the VM CPU supported the sse2 instruction;
- Built and installed the i386 package with the proposed patch;
- Ran the test script provided in [1] to look for regressions (no regressions found, no performance boost observed);
- Changed the VM CPU to support avx2/sse3 instructions and re-ran the test. Now, the performance boost was observed;
- Finally, Changed the VM CPU for a pre-pentium 4 micro-architecture, where sse2 is not available (this is the most important i386 test here).
- Re-ran the test script. No performance boost observed. No regressions observed.
This provides enough evidence that no regressions should be introduced if the patch is introduced for i386 users with machines that do not support avx2/sse3/sse2 instructions.
[1] https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1882279/+attachment/5380754/+files/test.php
While this was reviewed upstream and is ready to land, it will not make it into 8.2 yet. This has been reverted for now because it exposes the code base relationship with glibc (https://github.com/php/php-src/commit/813d942bac2b604bb7f6b80aefac6e4aa69b3491), breaking MacOS builds.
added 13 commits
-
25449c7b...4d1949d6 - 12 commits from branch
php-team:debian/main/8.1
- e68d61fe - Fix detection of unknown gcc function attributes
-
25449c7b...4d1949d6 - 12 commits from branch
mentioned in merge request !9 (closed)