I claim professionally that I can write fast code. Most of the time I don't, as I am writing stable code fast. It is much more important to write fast algorithms, and have sensible architectures, than spend ages tweaking your source to the point of unreadability. If we factor my wages versus a better grade of SCSI raid array, large scale rewrites are not cost effective.
Most of my previous commercial experience doing this is actually not-doing-things-unnecessary-things-very-often (e.g. parsing config files), setting up parallel processes carefully, so nothing ever “busy waits” (which is a bigger problem than shallow analysis would tell you, for network heavy problems), and databases.
Specifically at mIS (a tier two UK ISP), the datasets grew by over 1000% as the company expanded whilst I worked there. A simple comparison is not possible as network usage is different over the different network technologies, but as mIS approached enterprise size, we were doing a more mature level of engineering. I was doing business systems, not webpages.
To write fast code, measure everything; and adjust your database indexes, your database settings, your php cache, and your network setup, your kernel io settings. In my experience that is the large slowdowns. If all of those are at their affordable limits, and you need to reduce latency; adjust the way things are done, rather than rewrite code. For example do you actually need to parse XML to achieve your goals?
Having written all of the above, I still can write fast code. UPDATE: Updating to PHP7 is a clear gain.
Third party performance tweaks in PHP
- This has quite a lot of information, I would rate this one above the other articles in the list. Optimise your site, not your homepage source.
- this is very old material, but algorithms are algorithms
Please remember all the adverts by intel about getting a faster CPU to improve your browsing experience. Obviously this was to sell hardware, but in my experience, it won't effect browsing. Better DSL would.
This article was originally a intro to the php-benchmark, but it got too long, so I split it.