Live data from Hacker News

Ask HN: Will programmers write more efficient code during the memory shortage?

news.ycombinator.com

51–60 of 264 posts

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#51
Programmers might write more efficient code if the performance was unacceptable on their own laptops, but even in the not-flush-with-cash companies I've worked all my career, it's been easy for me to always have a dev laptop with twice as much RAM as most consumers have. I'm presently working on a laptop with 64GB, and we don't even use any local AI models. If a PE company is willing to spec dev laptops like this, even in the memory shortage, then I assume the memory pressure will never hit developers.

So, this carefree attitude directly shapes all code that runs client-side (JS + native apps) since the only impact on the company is whatever happens on the dev's laptop. The rest of the impact is "free" since it's paid (in either money or in misery) by customers.

For server side, I also highly doubt it, as being more memory efficient on the server side has always had a benefit to the company who pays the bill. The only things that may change may be the relative cost, but if management comes and says "AWS bill going up, help?" devs will say "OK, we can find ways to save RAM, but the team won't be doing any new features or fixing any customer-facing bugs during that time" and management will say "Okie dokie, we'll just pay the bigger bill then."

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#52

Algorithms and data structures aren't the problem, bundling Chromium to make a chat app is the problem. I think Rust's rise in popularity will probably lead to some benefits. Games will probably get more efficient but they're easier to scale down to the memory that's available.

> bundling Chromium to make a chat app is the problem.

Precisely. And all that extra resource wastage is completely free! (paid by your customers).

Perhaps if there were any big software companies who were so iconoclastic as to write fast software and avoid wasteful patterns like using Electron, pressure to do better could be felt, but every company that ships software[1] behaves the same so if anyone tries out competition due to performance beefs, they'll have no relief. They'll be forced to blame their hardware and upgrade it.

[1] Only exception of course is some indie developers. I don't know of any companies that have more than about 2 devs who haven't adopted the 'modern' approach, where we only fix performance issues that completely block using the app.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#53
I don't think we will in the HN snark sense of "this react site or electron app uses way too much memory". Those companies will continue to work in the same way, maybe even less efficiently as people chase modern UIs with extra animations or videos or effects, or with some AI code generation tacking on too many features or tech debt.

In specific sectors I do think we will see more optimization. If you're working on cloud compute or AI training / large scale data processing, there will be a big focus on optimization as prices are very large at that scale and shortages have a bigger effect.

Also in gaming I think the next cycle will be different. Big game studios used to push for the best possible graphics that might require the newest consoles or high end gaming computers, but the next releases might not be as much of an upgrade. The next gen of consoles or graphics cards themselves might be delayed, or be less powerful, or be too expensive and flop, as chip manufacturing companies continue focus on more lucrative markets and leave average consumers behind.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#54
post #27

If that happens, we will see it in triple-A games first. If some new titles have significant lower hardware specs than expected. If buyers can't afford the hardware anymore, the studios need to adjust. It's definitively possible to scale games down a lot. There are a few AAA games that were "dumbed down" for the Switch 1 (Hogwarts, cyberpunk, ...). And that's a really low-spec device. There are two factors: existing…

> If that happens, we will see it in triple-A games first. If some new titles have significant lower hardware specs than expected.

Recently I booted up Insurgency: Sandstorm. With a 5800X and an Intel Arc B580 at 1080p and high graphics, the game runs at around 200 FPS. Meanwhile, pretty much any modern UE5 title (with the exception of Ready or Not and Split Fiction, from what I've seen) runs horribly - the interesting thing is that no matter how much you tweak the .ini files or change the graphics settings you can't get something like STALKER 2 or The Forever Winter or Borderlands 4 to run as well as UE4 with the graphics similar to those old games. Instead you get something that runs at like 10% of the render resolution and still doesn't get 60 FPS (I'm not exaggerating, literally the performance I got in The Forever Winter).

There's no good technical reason for things to be that way (Unity still exists, and the games made in it struggle less) other than the devs or the higher ups choosing higher fidelity but more expensive rendering technologies and using upscaling and framegen not as something that helps laptops or when you need the spare GPU capacity (e.g. encoding a video recording of the game), but rather as something that's supposed to be used to even get to 60 FPS in the first place.

I don't know what needs to change for things to get better.

I also don't see anyone particularly caring about regular software, Electron et al are just too convenient to develop in (having to create per-platform UIs sucks in already-overworked teams).

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#55
post #3

I've dumped python for anything that doesn't involve scipy / pytorch in favor of go. So yes, I'm having my llm's output go now which is generally more memory efficient than python.

Python isn't even that bad, I have python desktop apps that use 50mb of memory. More than needed but not 1-2gb realm people complain about with electron stuff.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#56
post #34

claude code and friends will make it much easier to rewrite python/js/$memory-hungry code in rust.

and make memory hungry rust code with unsafe everywhere. Way to go!

None of my LLM created rust code has unsafe, or unwrap and must pass clippy checks..

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#57

Some programmers will write more efficient code. At my $dayjob (one of the big tech companies) we're already planning a major goal next year of optimizing server code to reduce RAM requirements, and this is directly in response to the crunch. In practice I expect most optimizations will come from "stop doing stupid stuff" and not "use fancy advanced algorithms." But that's a cynical perspective so don't be cynical li…

Real, there are so many low hanging fruits for optimization but no one has time to do them. And they don’t incentivize spending your time on it either.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#58
post #32

If the producers see a long term demand for memory they will meet the challenge and produce enough to bring prices down. Economics will invariably alleviate the memory crunch. It just takes long and requires a huge upfront CapEx. They have been burned in the past and are hesitant to over invest, worried that the bubble might burst. I expect high prices to stick around for a while, but I would be surprised if this was…

From a paywalled article in the WSJ:

“ The China card

Two Chinese chip makers—CXMT, the country’s top DRAM producer, and Yangtze Memory Technologies, which focuses on NAND storage—are growing fast and want to expand their global clientele. China is the closest thing to a quick fix for the chip shortage, but the solution is at best partial.

Yangtze Memory is building three new factories in China that would more than double its current capacity by the end of 2027, people familiar with the plans said. Meanwhile CXMT is seeking to raise $4 billion in an initial public offering in Shanghai, and it is building new factories. It said its revenue rose by more than 700% year-over-year in the first quarter of 2026, though it acknowledged that its products still trail those of the three industry leaders.”

Gift link: https://www.wsj.com/tech/why-the-memory-crunch-is-almost-imp...

Post reply on HN