logoalt Hacker News

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

113 pointsby amichailyesterday at 10:51 PM190 commentsview on HN

Maybe there will even be more interest in the invention and use of more advanced algorithms and data structures that use less memory?


Comments

xenatoday at 5:59 AM

Not unless you get promoted for writing more efficient code.

elAhmotoday at 9:07 AM

No

xnxtoday at 2:16 AM

AI (like alcohol) is the cause-of and solution-to all our problems.

Computer: Rewrite this python code in Go. Make it memory efficient.

segmondytoday at 12:25 AM

Will they? I don't know. Should they? Yes. If AI is so great, we should use it to optimize. Rewrite all the bloat into lean efficient systems...

casey2today at 7:20 AM

Backwards thinking programmers might (there is currently plenty of memory efficient software; but it's always missing that feature you really need funny how that works). Forward thinking ones will realize we are heading towards the glut of all gluts and buy 4TB to play around with.

cheesecakegoodyesterday at 11:11 PM

Memory? Doubt it.

But I’m hopefully optimistic that we’ll see a renewed emphasis on speed and responsiveness, since users do notice that despite most products ignoring it.

koliberyesterday at 11:36 PM

No. The cost of one programmer’s hour of work compared to the increase in price of RAM is not very big. One is a variable cost one is fixed.

linhnstoday at 6:19 AM

Probably not, clarity still triumphs

novafuncyesterday at 11:04 PM

I don't see the trend reversing, but if we're lucky, perhaps a freeze. Won't get more efficient but may not get worse.

sudoshredyesterday at 11:32 PM

Depends. I can certainly offer to rewrite my old code that contributed to the memory shortage, for a price.

__mharrison__today at 6:03 AM

I think they are writing shorter code for to token limits...

(Just refactored an app to do this. 60k lines to 20k)

jklein11yesterday at 11:30 PM

A few will write low level code that will make all code behave more memory efficiently.

Uptrendayesterday at 11:00 PM

Lad, modern day "programmers" don't even know what memory is. You'll be lucky to find any "software engineer" who can even tell you what a pointer is.

show 1 reply
pjmlptoday at 5:58 AM

One could hope for.

garyfirestormtoday at 4:04 AM

Let me get this straight. We have a memory shortage due to AI slop which is not really efficient and to solve that problem we need to stop the AI slop and hand write the code.

physixyesterday at 11:27 PM

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 permanent.

Which means to me, that price pressure probably won't be the driving force for writing more memory efficient software.

For those who want, I expect AI to make it easier to do that, assuming it's done right, i.e. not vibe coding it.

If you have a subscription to The Economist, I recommend listening to this Money Talks podcast. They talk about the shortage and the economics behind it.

Can anything stop South Korea’s bull run?

https://www.economist.com/podcasts/2026/05/21/can-anything-s...

show 1 reply
Insanityyesterday at 11:30 PM

I doubt many of the newer generation ever even tried. Maybe they had a course at uni where they did some C or Assembly, but that's probably the extend of it. So no, I don't think so lol.

vrightertoday at 4:13 AM

those that did before still will.

Those that didn't still won't

__stoday at 1:11 AM

currently porting code from Go to Rust primarily motivated by memory efficiency gains

MaulingMonkeytoday at 4:26 AM

> Will programmers write more efficient code during the memory shortage?

Yes. No. Yes.

I've worked in gamedev, helping ship code that ran on consoles. Nice fixed hardware targets. You OOM, you crash. We crashed a lot, and cut and saved and optimized and explicitly invoked the garbage collector twice on level transitions, because a single full scripting language GC doesn't work when finalizers must run to deref C++ objects to unroot script objects, and committed other horrific hacks.

The memory shortage may eventually impact fixed targets like this. Or the minspec publishers will swallow for fuzzier targets like "PC". But it takes awhile for new targets to roll out, and for newly bought PCs to make a significant dent on total percentage of PC ownership. Steam Machine's about to release with 16+8GB and while price and market saturation may be affected by the memory shortage, I'd be suprised if the actual spec changed.

> Maybe there will even be more interest in the invention and use of more advanced algorithms

Not for typical gamedev IMO. There the focus will be more on "reduce the amount of content loaded in memory simultaniously". That means less detail, smaller scale, or less variation. Going from 4096x4096 to 2048x2048 textures quarters your texture memory usage. The surface of meshes also has some square density nonsense going on. Basic animation tends to scale with bone count and keyframes, which are more linear, although shape keys are more per-vertex nonsense.

And of course, reusing the same mesh or texture multiple times doesn't use more memory, just more memory bandwidth.

Audio is more a factor of "how many sound effects (and variants) do we need preloaded just in case there's suddenly an event that triggers them".

These are the big ticket items for memory use and advanced algorithms don't help much. Rather, the algorithms help stretch whatever amount of memory you do have to provide the best amount of quality you can, and the small constant shift in total memory availability doesn't change the calculus for how important that is very much (which depending on the game ranges from "unimportant, everything fits in memory easily" to "critical, we're doing open world streaming and we've got terrabytes of raw data already, 16 vs 64GB of memory doesn't change that much")

> and data structures that use less memory?

Some bit packing type stuff comes up for smaller logical data structures in gamedev, and that can be useful for saving memory bandwidth, but I'm skeptical of how critical it is for total memory usage outside of the occasional Factorio.

digitaltreestoday at 5:11 AM

No

whateveraccttoday at 5:03 AM

no

holoduketoday at 4:58 AM

Yes. Let's hope bloated frameworks like react, angular and vue with their dreaded hydration and ssr approaches will be replaced with pure clientside applications with stateless servers with small data apis only. That alone will reduce zeptibytes of memory requirements in the world.

DANmodetoday at 4:54 AM

It could certainly be used as a way to sell killing some technical debt for performance improvements to management, for anyone struggling to.

“The new MacBook only has 8 gigs of sheep - we need to go resource-lean!!1!”

Joker_vDyesterday at 11:20 PM

Of course not. Why would they? The software nowadays is mostly written for people who already own computers with RAM already installed. Yeah, they probably won't upgrade for the next couple of years, so what?

Besides, have you heard about "virtual memory" and "swapping"? Nowadays, SSDs (and especially NVMe) are quite fast, so thrashing is much less of an issue.

thewhitetuliptoday at 3:17 AM

Are there promotion metrics tied to app performance? Or are they tied to deliverables?

Unless that changes we won't see any spike in optimization

jinpanyesterday at 11:29 PM

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

show 1 reply
Jtariiyesterday at 11:29 PM

no

jswelkertoday at 3:09 AM

This is sadly a Betteridge's Law of Headlines situation.

wseqyrkuyesterday at 11:01 PM

I don't think at this point in history limitations drive the the way we do things, abundance does.

show 2 replies
Liongatoday at 6:00 AM

Lets all run a 1GB RAM Terminal application called Claude Code, because even the seven figure payed engineers at Anthropic with Fable and Mythos are too retarded to do any kind of reasonable engineering.

m00dytoday at 6:57 AM

just switch to Rust.

burnteyesterday at 11:15 PM

No.

antisoltoday at 6:12 AM

  > Will programmers write more efficient code during the memory shortage?
Hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
reinitctxoffsettoday at 4:44 AM

Depends entirely on how competitive / adversarial the market segment is. And there are wild nonlinearities, just as you care a lot whether or not something fits in an 8-way set associative L1d but once you're too big or bank conflicted to make it the cost model drops sharply until you're about to spill the L2.

The hackers doing the drone software in Ukraine will go to enormous lengths to get something onto Jetson Orin, but once it needs Thor? New cost model.

I think what the parent might be asking is whether the cost of DRAM will be passed along to the most powerless actor in the system, and that depends on whether it's a real competition (war, HFT) or a pillow fight between frenemies (consumer Internet, too big to fail AI lab).

Us liberals have this quaint idea that good referees make capitalism an adversarial contest instead of a rolodex contest, but that idea is out of fashion at the moment.

marton-laszlo-atoday at 9:31 AM

[flagged]

ameonyesterday at 11:19 PM

[dead]

focusgroup0yesterday at 11:38 PM

[dead]

tristanjyesterday at 10:57 PM

Programmers won't, but LLMs will.

show 2 replies