Live data from Hacker News

There's no reason for software to be slow anymore

danluu.com

61–70 of 530 posts

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

#63
post #29

One article said secure software was here because of AI, this one says it can now be performant. Yet when I ask for code it writes, by default, both slow and insecure code that mostly works. Kinda. As I try to get AI to rewrite it into more secure, less bloated and optimized code is when it starts to randomly crash. Then I read articles about how AI is "moving too fast" and cry.

It's all about the test suite. The test suite becomes an executable specification, and the better the spec, the better the results you can get from AI.

How do you write a spec for correctness? Only the small and unimpressive programs can be checked exhaustively.

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

#64

One article said secure software was here because of AI, this one says it can now be performant. Yet when I ask for code it writes, by default, both slow and insecure code that mostly works. Kinda. As I try to get AI to rewrite it into more secure, less bloated and optimized code is when it starts to randomly crash. Then I read articles about how AI is "moving too fast" and cry.

I cannot imagine how nitpicky people are. AI went from 'good autocomplete' to 'I just tell it to do an entire thing and it does it and it works the first try'.

Maybe pick languages that are more boring. That's what works for me. It worked for hiring crappy outsourced programmers and it works for AI. It seems to do well with PHP - no long running processes / side effects. it works great with golang, simple language spec, and a very common style of writing.1

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

#65

Well, at least with the RAM crunch that the AI boom has caused, I hope there will be some sort of pressure to write efficient software, otherwise device manufacturers are quite fucked.

I've been hoping for this for my entire software engineering career but it never came.

It's messed up. Sometimes it feels like everything in the universe is aligned to ensure that skilled software engineers lead horrible lives full of anguish, frustration and powerlessness.

It feels like the economic system creates incentives which go against efficiency. So then it makes sense that software engineers would be most impacted.

There's a weird duality to our job; it's supposed to be about automation and efficiency but in reality, engineers who make the most money are those who create unnecessary complexity because it creates better lock-in and thus gives them more leverage in negotiations. And the tech monopolies they work for never seem to run out of money no matter how much enshittification occurs as a result.

Same perverse incentive for open source projects; engineers who lead projects that are full of bugs can charge more consulting fees and sell more enterprise licenses to work around the issues.

And engineers are often forced to use shitty tools by their employers so we're always stuck between a rock and a hard place with limited control over our output... Which we are blamed for when things go wrong but never given credit for when we pull heroic feats because those achievements are often overshadowed by missed deadlines resulting from being forced to use shitty software.

Adoption and quality are orthogonal, unfortunately.

Worst part is that nobody listens to us. Business people with money only listen to engineers who have money; who are mostly merchants of complexity. Engineers who care about efficiency have no voice in this market.

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

#66
Its more about discipline because you now have so much more option for that power, not just optimization. The engineer or the manager can choose more tech debt, then LLM's power is neutered because the complexity to optimize has increased by that much, and somehow evens out, and you are back to square one.

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

#67
post #29

Earlier quoted context omitted.

It's all about the test suite. The test suite becomes an executable specification, and the better the spec, the better the results you can get from AI.

How do you write a spec for correctness? Only the small and unimpressive programs can be checked exhaustively.

Not true at all! Most of the HTTP APIs, and a good chunk of the webapps, that I've worked on can be defined as a combination of an API spec that carves out valid and invalid behaviors, and a set of behavioral tests for the workflows that the client users care about. Working from a codebase which is generated from a spec document (e.g. OpenAPI or gRPC) and use of tools like https://pkg.go.dev/net/http/httptest and https://bun.com/docs/test/dom makes this a pretty achievable goal in practice.

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

#68
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…

> - The knobs you'd need to get serious performance are nearly unreachable in languages which LMs are good at (even Rust requires a discipline that the default language doesn't enforce). When you drop into the lower realms, you're trading consumption context for access to these levers. The levers are also "soft": you find yourself writing a bunch of skills, and tools to try and enforce the discipline.

Hasn’t been my experience at all. The latest LLMs can knock out assembly optimized subroutines and benchmark 100 different variations faster than I ever could dream of.

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

#69
post #29

One article said secure software was here because of AI, this one says it can now be performant. Yet when I ask for code it writes, by default, both slow and insecure code that mostly works. Kinda. As I try to get AI to rewrite it into more secure, less bloated and optimized code is when it starts to randomly crash. Then I read articles about how AI is "moving too fast" and cry.

It's all about the test suite. The test suite becomes an executable specification, and the better the spec, the better the results you can get from AI.

It's all now about money extraction from the areas dependant on software, not the sofrware itself.

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

#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 had purposefully written to be as fast as possible (hand wrote all the comopnents, didnt even use react).

I've been considering creating a skill / utility to do this based on learnings from the speedups - would others find this kind of thing useful?

Post reply on HN