logoalt Hacker News

jokoonyesterday at 10:07 PM10 repliesview on HN

it's probably time to call those old retired programmers to ask them how to reduce software memory footprint

or to teach that again


Replies

josephgyesterday at 11:23 PM

Taking a big, complex, already well optimised program like Chrome or the linux kernel and optimising the memory footprint is hard. But 90% of programs are just crappy web apps that nobody has even bothered to optimise at all. (Sometimes wrapped in electron or something.)

If you go look, you often discover that 90% of the requests are useless, or at least could be combined. That 60% of bandwidth is used up by 3 high res images which get displayed at 30x30 pixels. That CPU performance is dominated by some rubbish code that populates an array of a million items every call, then looks up 1 element then throws the whole thing away, only to regenerate the exact same list again a few microseconds later.

We have plenty of RAM. In absolute terms, 8gb of ram in the macbook neo is 8 billion bytes. 64 billion ones and zeros. You don't need rocket science to make a CRUD app that runs well with that much ram.

Computers don't get slower over time. If we were merely as lazy with computing resources as programmers 10 years ago, most programs would scream on modern hardware.

show 1 reply
whynotmaybeyesterday at 11:01 PM

I can save everyone a few Mb of memory now :

1. Check that you really need a SaaS SPA to solve the communication issues between your team members.

2. HTML and css should be enough for 99% of corporate websites.

3. Resize the images on your websites, they're too big.

4. Use teams in the browser, not as stand-alone app.

show 1 reply
Waterluviantoday at 12:44 AM

This feels kind of worn out. Yes we use more memory but we have more to work with. At the very worse you just let your favourite LLM take a pass at improving memory usage. For example, yesterday I was debugging an Electron crypto mining blockchain 2.0 app and the WebWorkers wou—-

  ?OUT OF MEMORY ERROR IN 0
  READY.
  >
nostrademonsyesterday at 11:03 PM

This is happening, sort of. All the big tech companies have major initiatives going to reduce RAM usage.

The old graybeards who know how to optimize efficiency may not work for them anymore, though.

autophagianyesterday at 11:54 PM

Seems unnecessary. We can simply ask the LLMs to do it after, of course, imploring them to not make any mistakes.

rat9988yesterday at 10:10 PM

The art is not lost, just not funded. Feel free to fund the programmers for your own software projects.

show 2 replies
manicennuiyesterday at 11:30 PM

Why not ask your LLM?

bitwizetoday at 2:08 AM

Nonsense. You prompt an adversarial agent to look for bottlenecks and suggest improvements in what your coding agent wrote, "and don't make mistakes".

benjiro3000yesterday at 10:32 PM

[dead]

zozbot234yesterday at 10:37 PM

Just rewrite your biggest memory hogs in Rust, it routinely slashes RAM footprint and demand for RAM throughput. The effect is even bigger than the typical reduction in CPU use. You can even ask AI to help you with the task, it will use a lot less RAM for it than the rewrite will save down the road.

show 1 reply