Optimizations Galore

Written on 2026-01-21

Join over 14k subscribers on my mailing list. I write about PHP news, share programming content from across the web, keep you up to date about what's happening on this blog, my work on Tempest, and more.

You can subscribe by sending an email to brendt@stitcher.io.

Hi

I worked on a pretty interesting problem for the past few days: I had to process millions of database rows and wanted to do it in minutes instead of hours or days. With some help, I went from processing 30 to 50,000 rows per second and dropping the total runtime from around 50 hours to an hour or so. It was a really fun exercise, and I documented the process here.

Now I have to say one thing: some people reached out to me saying that I could have solved this purely on the database level or by using other languages and tools. Someone said I was "bragging my bicycle goes 40 km/h downhill after removing the training wheels, while ClickHouse is doing mach 3 on the same data with one query planner pass".

To me, that's comparing apples to oranges. There's a place and time for any tool; for my use-case, on my blog, PHP is definitely the choice that makes most sense. My goal wasn't to get the absolute best speed possible in the universe, it was to see how much I could optimize a problem within some fixed boundaries; and I'm happy I was able to do that!

Let me know your thoughts, you can always reply to this email if you want to!

From the feed

That's all I wanted to share, have a great rest of the week!

Brent

Join over 14k subscribers on my mailing list. I write about PHP news, share programming content from across the web, keep you up to date about what's happening on this blog, my work on Tempest, and more.

You can subscribe by sending an email to brendt@stitcher.io.

Noticed a tpyo? You can submit a PR to fix it.
Home RSS Newsletter Discord © 2026 stitcher.io Login