Commit 212e5bc
committed
configure: disable Apple clang size optimizations that hurt runtime speed
Apple clang enables the AArch64 machine outliner and hot/cold code
splitting by default at -O2. Both trade speed for size: the outliner
inserts extra bl/ret pairs into hot paths (measured inside the inlined
zval destructor loops of zend_array_destroy, among others), and
cold-split fragments (4700+ in a default cli build) are compiled for
size, which mispredicted branch hints turn into slow hot code.
Disabling both speeds up a CPU-bound static analysis workload (PHPStan
analysing its own codebase, no opcache) by ~4% wall time on an Apple
M-series machine. The flags are added only when the compiler accepts
them (-Werror guards against clang's unknown -m flag warnings), so
non-Apple toolchains are unaffected.1 parent 43813f1 commit 212e5bc
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | 236 | | |
| |||
0 commit comments