Skip to content

Fix performance issues by enabling GCC global registers, disabling LTO

Daniil Gentili requested to merge danog/php:enable_gcc_regs into main

This package disables usage of GCC global registers in PHP, due to a yet-unsolved GCC compiler bug that breaks LTO when GCC global registers are used.

However, this cripples performance, as can be seen by comparing arch's PHP package (with and without !LTO/global registers) with ubuntu's packages.

The following benchmarks were made on ubuntu, arch and various arch-derived distros like cachyos using the exact same php.ini configuration:

image

(-basic variants use x86 or the specified architecture, -native variants use -march=native).

This MR fixes the performance issues by enabling global registers and disabling lto through !lto, though at least when building locally it seems like the !lto option simply isn't being applied for whatever reason (benchmarks were made by directly editing /etc/makepkg.conf, with -fno-lto instead of -flto=auto)...

Edited by Daniil Gentili

Merge request reports

Loading