Live data from Hacker News

100M-Row Challenge with PHP

github.com

61–70 of 104 posts

Re: 100M-Row Challenge with PHP

#61

A month ago, I went on a performance quest trying to optimize a PHP script that took 5 days to run. Together with the help of many talented developers, I eventually got it to run in under 30 seconds. This optimization process with so much fun, and so many people pitched in with their ideas; so I eventually decided I wanted to do something more. That's why I built a performance challenge for the PHP community The goal…

5 days to 30 seconds? What kind of factor/order of magnitude is that damn

What takes 5 days to run

Re: 100M-Row Challenge with PHP

#62

This is why I jumped from PHP to Go, then why I jumped from Go to Rust. Go is the most battery-included language I've ever used. Instant compile times means I can run tests bound to ctrl/cmd+s every time I save the file. It's more performant (way less memory, similar CPU time) than C# or Java (and certainly all the scripting languages) and contains a massive stdlib for anything you could want to do. It's what scripti…

Can't speak for go... but for the handful of languages I've thrown at Claude Code, I'd say it's doing the best job with Rust. Maybe the Rust examples in the wild are just better compared to say C#, but I've had a much smoother time of it with Rust than anything else. TS has been decent though.

Re: 100M-Row Challenge with PHP

#63

Earlier quoted context omitted.

It's almost comical how often bring up Rust. "Here's a fun PHP challange!" "Let's talk about Rust..."

Sorry, but it's honestly just a lot of our journeys. Started on scripting languages like PHP/Ruby/Lua (self-taught) or Java/VB/C#/Python (collage) and then slowly expanded to other languages as we realized we were being held back by our own tools. Each new language/relationship makes you kick yourself for putting up with things so long.

I don't know about that... I like Rust a lot... but I also like a lot of things about C# or TS/JS... I'll still reach for TS first (Deno) for most things, including shell scripting.

Re: 100M-Row Challenge with PHP

#64
post #61

A month ago, I went on a performance quest trying to optimize a PHP script that took 5 days to run. Together with the help of many talented developers, I eventually got it to run in under 30 seconds. This optimization process with so much fun, and so many people pitched in with their ideas; so I eventually decided I wanted to do something more. That's why I built a performance challenge for the PHP community The goal…

5 days to 30 seconds? What kind of factor/order of magnitude is that damn What takes 5 days to run

Poorly made analytics/datawarehouse stuff.

Re: 100M-Row Challenge with PHP

#65

Are they just confused about what characters require escaping in JSON strings or is PHP weirder than I remember? { "\/blog\/11-million-rows-in-seconds": { "2025-01-24": 1, "2026-01-24": 2 }, "\/blog\/php-enums": { "2024-01-24": 1 } }

> The output should be encoded as a pretty JSON string. So apparently that is what they consider "pretty JSON". I really don't want to see what they would consider "ugly JSON". (I think the term they may have been looking for is "pretty-printed JSON" which implies something about the formatting rather than being a completely subjective term)

Pretty JSON not meaning formatting, but more "That was pretty JSON of you."

Re: 100M-Row Challenge with PHP

#66
post #11

Earlier quoted context omitted.

Pitch this to whoever is in charge of performance at Wordpress. A Wordpress instance will happily take over 20 seconds to fully load if you disable cache.

Wordpress is something that I cannot believe hasn't been displaced by a service that uses a separate application for editing and delivery. It seems like something like vercel/cloudflare could host the content-side published as a worker for mostly-static content from a larger application and that would be more beneficial and run better with less risk, for that matter. Having the app editing and auth served from the sa…

As someone who built full ecommerce websites on wordpress over 15 years ago, I can tell you exactly why it hasn't been replaced - the plugin/theme ecosystem.

There are tens of thousands of plugins and themes to make a Wordpress website do whatever you want and look however you want, either for free or a very low fee. You have to replace that entire ecosystem for the same price to replace Wordpress.

No matter how many times people get hacked, the perceived value of getting something for nothing outweighs the eventual cost.

Re: 100M-Row Challenge with PHP

#67
post #66

Earlier quoted context omitted.

Wordpress is something that I cannot believe hasn't been displaced by a service that uses a separate application for editing and delivery. It seems like something like vercel/cloudflare could host the content-side published as a worker for mostly-static content from a larger application and that would be more beneficial and run better with less risk, for that matter. Having the app editing and auth served from the sa…

As someone who built full ecommerce websites on wordpress over 15 years ago, I can tell you exactly why it hasn't been replaced - the plugin/theme ecosystem. There are tens of thousands of plugins and themes to make a Wordpress website do whatever you want and look however you want, either for free or a very low fee. You have to replace that entire ecosystem for the same price to replace Wordpress. No matter how many…

I did a short contract a few years back where multiple WordPress plugins were pulling different versions of guzzle and I had to use a namespace rewriter to be able to run multiple guzzle versions at the same time.

The thing about WordPress is you can put it on a box and lock it down so hard you just treat it as an untrusted process on your server.

Re: 100M-Row Challenge with PHP

#68
post #66

Earlier quoted context omitted.

Wordpress is something that I cannot believe hasn't been displaced by a service that uses a separate application for editing and delivery. It seems like something like vercel/cloudflare could host the content-side published as a worker for mostly-static content from a larger application and that would be more beneficial and run better with less risk, for that matter. Having the app editing and auth served from the sa…

As someone who built full ecommerce websites on wordpress over 15 years ago, I can tell you exactly why it hasn't been replaced - the plugin/theme ecosystem. There are tens of thousands of plugins and themes to make a Wordpress website do whatever you want and look however you want, either for free or a very low fee. You have to replace that entire ecosystem for the same price to replace Wordpress. No matter how many…

Maybe it's just my poor imagination but how many plugins are truly unique to WP that you can't find on other CMSs? The only ones that come to mind would be those plugins that help connect to various B2B or B2C workflows, is that where the gold is mostly found?

Re: 100M-Row Challenge with PHP

#69

This is why I jumped from PHP to Go, then why I jumped from Go to Rust. Go is the most battery-included language I've ever used. Instant compile times means I can run tests bound to ctrl/cmd+s every time I save the file. It's more performant (way less memory, similar CPU time) than C# or Java (and certainly all the scripting languages) and contains a massive stdlib for anything you could want to do. It's what scripti…

It's almost comical how often bring up Rust. "Here's a fun PHP challange!" "Let's talk about Rust..."

Yep. It's like a crossfit vegan religion at this point.

You don't even have to ask. They will tell you and usually add nothing to the conversation while doing so.

Quite off-putting.

Re: 100M-Row Challenge with PHP

#70
post #11

Earlier quoted context omitted.

Pitch this to whoever is in charge of performance at Wordpress. A Wordpress instance will happily take over 20 seconds to fully load if you disable cache.

Much like anything else your performance is going to vary a lot based on architecture of implementation. You really shouldn't deploying anything into production without some kind of caching. Whether that's done in the application itself or with memcached/redis or varnish or OPcache.

Either you use a slow language and deal with caching or you use a fast language and just put Cloudflare/Bunny/etc in front.
Post reply on HN