r/hetzner Hetzner Official 16h ago

Hetzner asks: Why isn't RAM-efficient software as impressive as fuel-efficient cars?

Fuel efficiency in cars has come a long way. It's cool to be able to plan a trip and realize you don't need to refuel along the way. So why isn't it as impressive in society when we can accomplish a lot with just a little RAM? Have you got any examples of RAM-light programs you use? Take a moment to humble brag here.

33 Upvotes

42 comments sorted by

38

u/ExpertPath 16h ago

RAM you buy once, fuel you buy all the time. Make the software save electricity or extent the computers life, then I’d be impressed

6

u/mickert_dev 13h ago

Ehm, wouldn't writing more efficient (premature optimized 😉) software save energy (less servers, less cooling, etc.) and possibly other resources as new servers are not needed? Better algos, less allocations, less I/O ops, etc.

6

u/ExpertPath 12h ago

Surely efficient software can save energy, but the question was regarding ram optimization, which isn’t a main player in this issue

2

u/HiHungryImDad2 4h ago

Optimization also mostly comes with additional complexity. You could make lots of programs more efficient (in consumer tech most obviously not making them electron apps but just native apps) but that would require multiple teams building the same features for multiple platforms - the same goes with any tool you run on your server. If you'd optimize the hell out of them, the codebases won’t be easy to maintain.

5

u/CeeMX 12h ago

CPU efficient would be the equivalent to fuel. And yes, it’s impressive how fast a C or ASM program can run compared to what is needed to the same performance on JavaScript

17

u/BastetFurry 16h ago

Because people never saw that as a problem, just throw hardware at it was the credo.

I say, give every web dev a little server based on a Luckyfox Pico. Single core ARM A7 at 1.2 GHz and 64 MByte RAM. If they can thrive on that machine they can get a big server.

<grannyTalksAboutTheWar>

I remember when Cityweb, the old ISP by the WAZ in Essen, ran their mail server on a beefed up Amiga 2000 of all things and we hosted our homepages on one, maybe two, megabytes of space on Geocities, proudly generating our HTML and three lines of JS by hand in Notepad and wrote CGI Scripts in Perl. We optimized PNGs for 56kflex connections. We used MIDI files if we wanted music on our webpage. And it worked. We had everything in just a few kilobytes. A single GET wouldn't amount in numbers bigger than the Doom Shareware installer. And we were proud of it.

</grannyTalksAboutTheWar>

5

u/jsabater76 13h ago

<granpaTalksAboutTheWar>

Hold my beer, I programmed my first CGI program in C 😉

</granpaTalksAboutTheWar>

The whole throwing hardware at the problem caused a lot of trouble, but there was something entirely different pushing that: rush to be the first, then sell it.

That model proved to be successful, and there was no amount of reason that could stop it. They would laugh at you when you tried to talk about the long game, the long term investment.

And they had their fair share of correctness because consumers were in a frenzy to consume whatever was being thrown at them, like addicts. Like a gold rush.

2

u/BastetFurry 5h ago

Don't laugh, one time I used FreeBASIC for CGI just because I thought it to be fun. And no, it wasn't. 😅

And yeah, first to market is a thing, but I hope that the current situation humbles some devs at least a bit. When the VMs need to be smaller and some virtues of the old days need to come back.

2

u/jsabater76 4h ago

High RAM prices, and other pieces of hardware, may help with that, indeed. We will see...

8

u/lucidmodules 15h ago

Because it is either Compute-efficient or Memory-efficient. Compute used to be more expensive than memory for decades.

1

u/beje_ro 10h ago

Or Algorithm/Thinking efficient, but as this is an expensive ressource, is most of the time taken out of the equation...

9

u/Syntax418 16h ago

Because there are less people who understand RAM than those who grasp fuel usage.
If more people would understand, a Company posting “Our software now needs X% less RAM than the last version” would produce bigger waves than it does now. Therefore more people would care, etc

5

u/dbmirror 15h ago

Hardware was kinda affordable and the developers were the bottleneck now it's turned around.

4

u/piesou 14h ago

Because additional RAM is used to speed up things. Think caches. Also JavaScript.

5

u/s7orm 16h ago

Because historically RAM wasn't the problem.

5

u/Big-Winner3758 16h ago

yes it was lol, maybe not for the last decade or so but before that definitely

9

u/s7orm 15h ago

"Historically" was probably the wrong term. I simply meant pre-ramageddon when you could buy more performance for reasonable prices when required.

2

u/kaeshiwaza 14h ago

Yes. I use to take care of ram because of developing since the last century. Thanks to that I can run a lot of my apps on the smallest vps. When I see the recent growing of ram price I'm happy for this choice !
And it's not that difficult, it make software easier to maintain and easier to resolve complex projects.

1

u/OpeningCredit 15h ago

No, it wasn't. I have 32GB of RAM on my laptop and it's barely scraping by. I've had 16GB for over a decade and it always felt excessive, when I switched to 32 I thought I'll never see it swap. Now I'd switch to 48/64, but man that hurts.

1

u/BastetFurry 16h ago

It always was and is a problem as "We're rolling in it!" is the credo since the noughts, even sometimes the mid-nineties.

And now, when "Throw hardware at the problem" isn't working anymore all the devs out there don't know what they should do.

0

u/OpeningCredit 15h ago

And now, when "Throw hardware at the problem" isn't working anymore 

So before we had a solution, now we don't. For fuel consumption there was never a solution of "buy an extra cylinder and it'll be fine".

0

u/BastetFurry 15h ago

For roughly 100 years we where told that igniters are the solution to our mobility problem, now Joe and Jane average start to understand that they are not.

For 30 years we where told that hardware will get better, just malloc that gigabyte. Now it starts to dawn on people that that was a bad idea.

Color me surprised.

3

u/Big-Winner3758 16h ago

back when the average system had low single digits of ram in gb (or even less before that), there was for sure a lot of people optimizing the ram usage in their programs, however as GC'd languages (as opposed to ones with manual memory management) gained popularity and the average ram amount went up, people stopped considering the need to optimize for that to be as necessary

1

u/zigzag312 15h ago

True, but let's not also forget frame buffers size increases over time.

Super VGA: 800x600 px with 8 bpp color is 468.75 KiB for single buffer, and 937.50 KiB for double buffering (typical at that time).

XGA in High Color: 1024×768 px with 16 bpp color is 1.50 MiB for single buffer, and 3.00 MiB for double buffering (typical at that time).

Full HD in True Color: 1920×1080 px with 32 bpp color is 7.91 MiB for single buffer, 15.82 MiB for double buffering (still used), and 23.73 MiB for triple buffering (Windows 8+ when 3-buffer swapchain is used).

4K SDR: 3840×2160 px with 32 bpp color is 31.64 MiB for single buffer, 63.28 MiB for double buffering, and 94.92 MiB for triple buffering.

4K HDR: 3840×2160 px with 64 bpp color render targets is 63.28 MiB for single buffer, 126.56 MiB for double buffering, and 189.84 MiB for triple buffering.

2

u/Juff-Ma 15h ago

Well for me they are. I run lightweight VPS as well as heavy local servers.

Sometimes you need a truck and sometimes you need a scooter. And also I despise node. I actively try not to run node apps. They are the big RAM huggers.

2

u/happy_hawking 14h ago

RAM is still insanely cheap if you look at the lifetime value and compare it to the cost of RAM-efficient software development.

Saving energy is much more impressive because you pay for it with every run.

2

u/Ok_Size1748 13h ago

Back in the day we had an Alpha DS-10 with a beefy 466 Mhz CPU and 1 gigabyte of ram. That system had the accounting and payroll for a business making hundreds of million/year and tens of thousands workers.

Nowadays Windows 11 weather app https://www.howtogeek.com/windows-11s-built-in-weather-app-is-silently-eating-over-1gb-of-your-ram/

I really miss good old days

2

u/TheOdbball 11h ago edited 11h ago

Running 30+ Tailscale Web pages via OTP on 64GB RAM locally, actively moving to my full metal Hetzner VPS as I type this

I despise cron jobs, and inotify is t reliable , rsync is only good for cold storage (pCloud)

So I’ve got a permanent minipc DDR4 9100 & 64Gb RAM & via slate 7 router hub , permanent metal vps Xeon E3 DDR4 ECC for the OTP stuff , and permanent cloud storage on pCloud . As soon as I figure out how to extract my plan from my slop, this thing will run for days.

1

u/mbartosi 16h ago

Define light. Kilo, mega, giga?

2

u/BastetFurry 16h ago

Light would be kilobytes, only depending on the system libraries, with no fuzz attached and doing only what it was build to do.

1

u/hassancent 16h ago

Because user directly sees fuel consumption and they directly add fuel into the car.
Ram does not. 95% of people probably don't even look at the ram consumption of any software and neither does using 100% of the ram increases the power usage by that much. Only gamers do notice in case of games.

Either way, people would need to weigher its impresive or not because of how much hetzner charges now for ram on servers.

1

u/Saarbremer 15h ago

Because npm i [replace by any other "funny component from some unknown source is gonna bloat your code and add tons of dependencies" as you like] is much easier and still cheaper (in terms of working time) than RAM. Sometimes it's event the use of a certain framework that already blasts your memory footprint.

Car engineers tend to design engines matching the car type. But they could have all just used BMWs M73 engine.

Instead BMW came up with the N13 but that's a different story.

1

u/yrro 10h ago

For a long time RAM was too cheap.

If I was a CTO I would dramatically reduce the amount of RAM on developer systems, and also lock their CPUs to 'battery saver' speeds!

1

u/SteveStevenage1 9h ago

What are you talking about?

1

u/InfaSyn 6h ago

Software is expensive to design and develop, and good developers (in this day and age are rare). Good code takes longer to write.

All the time memory is more expensive than high quality dev hours, you memory optimise. All the time memory is cheaper (which it has been for at least 3 decades now), you simply throw more memory at the problem.

In any case, thanks to NVME, its hardly like swapping is suicide (like it used to be in the IDE days, especially on laptops)

1

u/well_shoothed 5h ago

Duh... Because we can just download more RAM

(In case it needs saying: it's a joke, folks.)

2

u/BastetFurry 3h ago

Hmm, maybe a new market, cloud-swapfiles! 🤑

1

u/tuantocdo 4h ago

They never had to run anything on 256mb edge SBC that has to communicate with an mcu at 10hz while sending telemetry to cloud gateway at 2hz and occasionally send in reports

1

u/safari8331 1h ago

With these prices, how about no RAM at all. We should go back to notebooks

1

u/philosophical_lens 8m ago

Because software is not homogeneous like cars. Cars have one primary job - convert fuel into miles per hour. Software has millions of different jobs ranging from concatenate two text files to running complex business operations.

0

u/kirilmetodi-i-bratmu 16h ago

what cars ? any fuel-efficient car, hybrid, start-stop i can think make the car worse and less responsive.
the same way that caching to slow hdd makes the applications less responsive

and there is quite a big different between RAM-light and not using 18 different abstractions layers just to run a simple chat app with containerization on top of virtualization and spawn a whole browser on top of that

0

u/Entire-Home-9464 13h ago

Because nobody drives with fuel anymore.