performance - What is the difference between different generation processors with the same clock speed when talking about PHP code execution?
one text
Solution:
Can you decide which PHP version the benchmark will run on? And is OPcache enabled?
If so target PHP 8.0 and utilize the JIT compiler which runs on x86 CPUs (i.e. Intel/AMD).
Other micro optimisations is using the fully qualified name of the function if you are in a namespace as certain functions are special cased by the VM.
However, your algorithm will always be the bottleneck and if you can improve that you'll get better results than doing tiny language config optimizations.
So benchmark often and try to reduce the big O notation cost. :-)
Source