Live data from Hacker News

There's no reason for software to be slow anymore

danluu.com

131–140 of 529 posts

Re: There's no reason for software to be slow anymore

#131
post #28

Jevon's paradox implies we're getting more fast software, and more slow software. Sturgeon’s law implies the ratio will remain the same. 90% of what ships will be slow, buggy, slop. Just as it was before LLMs.

I wonder if AI has changed the 90% rate. From my perspective it’s already increased the ratio of what I’d consider bad.

I haven’t seen as big of an impact on the “good” side. People with attention to detail and craft can use it with great results but they’re not pumping things out at the speed of the slip slingers.

Re: There's no reason for software to be slow anymore

#132
post #31
post #22

Eh, not sure. Very few humans do software optimization productively, so I'm not optimistic about machines built by humans, either. Every encounter I've had with agentic optimization involved trying to apply a bunch of myths to an existing code base, in a way that seemed cool (unrolling loops, eliminating apparent branches, SIMD) but which was all pointless because the only credible optimizations were going to come fr…

Data point of one, but after a few months of uselessness, I have managed to get some pretty serious, measurable performance improvements with AI optimizations -- order-of-magnitude speedups of business critical processes which took days as well as significant latency reductions. But you need a really solid workflow, solid benchmarks which run quickly, and a lot of tokens -- plus a rigorous profiling workflow.

What I want is the PMU in the loop.

Re: There's no reason for software to be slow anymore

#133
post #55

Here's this boiled down: > A stochastic search process with an executable optimization objective over space of programs S can only maintain or improve the objective This is superoptimization. We've known this since the 80s (Massalin, STOKE is more recent: https://github.com/StanfordPL/stoke ) The only novelty is that the proposer is now way better with LMs. Further, there's a large number of reasons for software writ…

> iykyk

A story.

I have a friend, who is - like me - interested in the CRDT / collaborative editing space. He asked ChatGPT to write him a CRDT. Then he grabbed every good CRDT implementation, and asked chatgpt to benchmark and optimise his CRDT, using tricks and techniques from existing hand-optimised CRDTs. He got massive performance gains by doing this - which is really interesting! I think it helped that he had a clear objective function, and chatgpt could look at other projects for ideas on how to optimise.

He proudly boasted that his resulting code outperformed my diamond-types library. I asked him if he was comparing against the native implementation, or the -Oz webassembly build, running in a wasm vm. It was the latter. When he tested it properly, his CRDT was - and is - significantly slower than diamond types. As far as I know, chatgpt still hasn't been able to catch up. I tried myself using fable. Even with reference to my source code, Fable still doesn't understand what I did in diamond types and why. (... Maybe I should document what I did!)

I think his technique itself is solid though. I tried it myself. I asked fable to write a custom binary serialization format & parser. Then optimise. Then optimise, with explicit reference to existing libraries. Optimising with reference to other code made a huge additional difference. It is now nearly as fast as those libraries. (But still not faster than them.)

My takeaway is this: I think LLMs are exceptionally good at reading and understanding code. If you guide them to do so, they're good at profiling and benchmarking. But it seems like they're not very good at coming up with novel optimisations. If you have an obviously slow program (for example, some slop claude wrote), you can often get big speedups by asking it to benchmark and optimise. But if you have a complex, already well optimised codebase, like the zig compiler, claude doesn't seem very good at figuring out novel ways to improve things on its own.

This is good news for the 95% of slow software out there. But bad news for the 5% of us who write fast code already, but want our code to go even faster.

Re: There's no reason for software to be slow anymore

#134
post #70

This speaks to me. I've been running an autoresearch loop the past couple of days to improve the load time of my various projects' frontends. I've been really, really impressed with how effective this is. I went from a 4s load on simulated slow 4g to ~750ms: https://image.non.io/speedup-graphs.webp Side by side vid of the results: https://video.non.io/speedups.mp4 This was for https://non.io , which is something I ha…

Why is it so slow? Like clicking around this is a very simple site, it seems like the fade in and fade out, besides being jarring and annoying, is just adding load time.

Re: There's no reason for software to be slow anymore

#135
I gave Fable 5 access to the database and the browser and asked it to optimize for performance.

Woke up today with 2x improvement and fully tested.

The code optimized was mostly written by humans over the years. That code was too cumbersome to optimize by humans so we never touched it.

Re: There's no reason for software to be slow anymore

#136
post #44

One of the biggest causes of slowness is just waiting for web requests. The fact that so much software is either online or built using the same stack even if it isn't, puts all that software in this blocked/waiting state constantly while using it. Anyone not in the US feels this even more since so much online is US hosted, 300ms for every little interaction adds up quick. If your software has the affordance of a wait…

[dead]

Re: There's no reason for software to be slow anymore

#137

Yeah.... maybe . I think AI is still too prone to go down rabbit holes and not understand the whole picture well enough to come up with good optimisations. It's probably good at micro-optimisation, e.g. pre-allocating arrays. But is it going to realise that you don't need that array in the first place? I dunno. On the other hand it does mean there's no excuse for writing your program using Python or Electron or whate…

The reason for using Electron is to write once and run everywhere right?

I get that LLMs would make it faster to write distinct copies for different operating systems and maintain them both but thats still more costly than a single system.

Sorry if I’m misunderstanding the goal of Electron but it still seems cheaper and easier (although admittedly worse than multiple native apps)

Re: There's no reason for software to be slow anymore

#138

What about these reasons? - Your boss/most of the market doesn't care if your software is slightly slow - Your boss/the market wants new features It's easier now to slip in fun optimization features when no one's looking, but the incentives are still off.

I can't tell if you are saying the market doesn't care if your software is slow, or quoting someone else. Either way it's objectively false and that has been known for decades. Making users wait is a surefire way to make them engage with your product less, and the more you make them wait the less they will use it.

If your boss doesn't care about your software being slow he's incompetent.

https://services.google.com/fh/files/blogs/google_delayexp.p...

https://business.google.com/ca-en/think/marketing-strategies...

https://medium.com/ft-product-technology/a-faster-ft-com-10e...

https://www.pingdom.com/blog/page-load-time-really-affect-bo...

Re: There's no reason for software to be slow anymore

#139
post #121
post #106

Earlier quoted context omitted.

I've spoken with traffic engineers before, and the consensus I've gotten is that, excusing a few bad apples, much of the problems originate with popular or political interference.

I believe it, but what's the point of having them then.

To do the best they can do within the confines of what's politically acceptable. There's an intersection near me that is just horrendous, but the engineer I talked to, who is now retired, said it was his mentor's task to fix it some 50 years ago. Actually fixing it, though, would require removing parking spaces, and the mayors have routinely vetoed that idea after they received pushback.

The people are to blame. You get what you vote for.

Re: There's no reason for software to be slow anymore

#140

Much like security, optimization is now a function of token spend—which in some ways means it's a function of care. The reason why software may continue to be slower or less secure than it could be is simply that no one cares enough to invest the time and money in improving it. Off-topic, but Dan, in the name of all that is holy, throw a `max-width: 40em;` on your blog!

Reader mode (built-in to both Chrome and Firefox) does the trick.
Post reply on HN