Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PHP: 2x perf with Clear Linux vs Ubuntu

That's a staggering improvement.

https://www.phoronix.com/review/linux-os-amd-ryzen9-9950x/6



That's what comes with actually using the instruction set of modern CPU's instead of the lowest common denominator instruction set.

However, note that some of the modern instructions like AVX-512 use a lot of electrical power on the CPU, for example pushing a 12gen Intel chip above 300W.


I wouldn't write it all off on the AVX-512 in this case. As you can see in https://github.com/clearlinux-pkgs/php and other clearlinux repositories, the difference from other distros is:

1) a number of backported optimization patches

2) few patches in Linux kernel and glibc that were not accepted to upstream

3) and maybe the most important part: PGO for python, php and other performance-critical components. It is a well-known fact that PGO helps interpreted languages. And it is benchmark-oriented: for example, even though PGO helps bash, they don't enable it (maybe until somebody invents bash-bench).


Does benchmark-oriented means it's unlikely to help (or could even hurt) real world applications?


ClearLinux pulls phpbench-0.8.2 (and no other applications) for PGO[1] and then Phoronix benchmarks with phpbench-0.8.1. In my opinion, that's a valid reason to disqualify the result. It does not mean that PGO makes PHP faster or slower, it means that there are no measurements to make the conclusion. I only have theory, that PGO generally helps to reduce startup time, so that in case when app starts 1000s times per second, it helps even if PGO data is irrelevant. But modern PHP does not behave in this way, also some real-word PHP apps are usually CPU / I/O bound in database, so one may see no difference...

Some time ago I tried to apply PGO to Blender, which only hurt the performance, but that's the other story (I read it as: if application already has logical separation for kernels for CPUs, attempt to join and reseparate in PGO may hurt the performance).

[1] https://github.com/clearlinux-pkgs/php/blob/03c0859388a5d640...


Ubuntu is experimenting with making a more modern CPU build: https://discourse.ubuntu.com/t/trying-out-ubuntu-23-04-on-x8... https://www.phoronix.com/review/ubuntu-x86-64-v3-benchmark

Also -O3: https://www.phoronix.com/news/Ubuntu-Evaluating-O3-Optimized

I am not sure off hand how that CPU level compares to Intel Clear Linux's options. The phoronix comparison fo Ubuntu with and without v3 were mostly quite small single digit percent though, on an Intel CPU.

Notes: Canonical (Ubuntu) is my employer, I am not working on this project.


Hmm, -O3 at least used to have a bad reputation for producing potentially buggy and/or slow code.

That was years ago though, and I have no idea if that's changed for the better.


I do solidly remember this from the "earlier" (200x) Gentoo days.


An interesting part of Zen 5 architecture was related to lowering the absurd instruction passthrough time/power if I remember correctly!

This definetly used to be the case on the older Intel implementations of large SIMD instructions (my Tiger lake chip being an anecdote)!


This is what bothers me about the characterizations of CPU architecture in ELF files and (IIRC) Python eggs...

They're so vague about which particular x86 ISA variants are compatible with the binaries.

So, e.g., a program loader doesn't necessarily verify that the binary will work on the CPU.

Or, as we see with Linux distros, they build packages for the lowest common denominator ISA.

(Note: it's been a while since I dealt with this, so I might be remembering a bit wrong.)


> for example pushing a 12gen Intel chip above 300W

And pushing 13th and 14th gen chips into an early grave! /s


Not really because AVX-512 isn't supported by those platforms; supposedly something related to processes in general being very unhappy if they're being scheduled to E cores that doesn't handle those instructions randomly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: