logoalt Hacker News

tiffanyhyesterday at 1:43 PM3 repliesview on HN

Aren’t these optimizations less about PHP, and more about optimizing how your using the database.


Replies

toast0yesterday at 5:24 PM

PHP is kind of like C. It can be very fast if you do things right, and it gives you more than enough rope to tie yourself in knots.

Making your application fast is less about tuning your runtime and more about carefully selecting what you do at runtime.

Runtime choice does still matter, an environment where you can reasonably separate sending database queries and receiving the result (async communication) or otherwise lets you pipeline requests will tend to have higher throughput, if used appropriately, batching queries can narrow the gap though. Languages with easy parallelism can make individual requests faster at least while you have available resources. Etc.

A lot of popular PHP programs and frameworks start by spending lots of time assembling a beautiful sculpture of objects that will be thrown away at the end of the request. Almost everything is going to be thrown away at the end of the request; making your garbage beautiful doesn't usually help performance.

show 1 reply
hu3yesterday at 2:07 PM

It's still valid as as example to the language community of how to apply these optimizations.

swasheckyesterday at 2:11 PM

in all my years doing database tuning/admin/reliability/etc, performance have overwhelmingly been in the bad query/bad data pattern categories. the data platform is rarely the issue

show 1 reply