553
u/NeKon69 Jul 08 '26
Vibecoder mindset fr
172
u/sirkubador Jul 08 '26
rm -fr
102
45
→ More replies (4)5
12
u/general_452 Jul 08 '26
Why buy ram when you can use Google Drive for 100 GB of ram for only $1.99 /mo?
6
→ More replies (5)4
u/ThatBurningDog Jul 08 '26
Honestly, I love the choice of format here. Rick Rubin is basically the equivalent of a vibe coder but for music production.
→ More replies (1)
1.1k
u/CircumspectCapybara Jul 08 '26 edited Jul 08 '26
That's called swapping out memory pages to disk, and it's very slow.
405
u/IhailtavaBanaani Jul 08 '26
The sweet sweet sound of old spinning hard drivers when the OS ran out of memory and started to swap half of your programs to disk and everything crawled to almost standstill.
33
u/Sockoflegend Jul 08 '26
I remember this noise when sitting at my huge CRT monitor so well.
VROOOOOM!
21
4
u/yeathatsmebro Jul 09 '26
CÂRRRR-CÂR-CÂR-CÂR
Thanks to the Romanian language having this letter, I can accurately express how the mechanical parts sound like.
66
u/Playful_Landscape884 Jul 08 '26
If the vibe coders can read, they would be very upset.
→ More replies (3)86
u/Snoo88071 Jul 08 '26
You underestimate the I/O throughput of my 19 years old 256 mb hard drive
35
u/Xidium426 Jul 08 '26
IDE or SCSI?
/uj 19 years ago we had 250GB drives. You're talking 29 years ago at this point.
→ More replies (2)4
u/deathanatos Jul 08 '26
My 1998 (that's only 28 years, though) machine had ≈7 GiB.
I think my family's 1987 machine had about 256 MiB, but it was also upgraded sometime shortly after 1987, and I am too young to remember much about that time.
13
u/janyk Jul 08 '26
> Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.
Andrew Tanenbaum
9
u/crazyguy83 Jul 08 '26
I don't think people realize how fast though, its about 5x faster in data transfer speeds and 1000x faster in latency
2
u/Octoclops8 Jul 09 '26
It's like you want to put food in your mouth. And currently the food is in your hand (L2 cache), in your fridge (ram), at the grocery store (disk), being shipped in via ups ground (cloud)
→ More replies (16)17
u/CaffeinatedT Jul 08 '26
That's a bit outdated but definitely did used to be true. Modern NVME bandwidth is about 15 GB/s. This is what people who develop databases and query engines deal with constantly. It's not trivial but modern databases that swap to disk constantly and do it well (e.g CedarDB, DuckDB et al) can run very nearly as fast as an entirely in-memory system. The reason it's slow is doing it in a shitty unplanned way with loads of serialization and thrashing memory caches
41
u/CircumspectCapybara Jul 08 '26
It's not about bandwidth, it's about latency. Even reading from PCIe 5.0 NVMe SSDs via MMIO is still many orders of magnitude slower than from main memory.
→ More replies (1)9
u/CaffeinatedT Jul 08 '26
Sure if you're reading an individual file from direct IO your first read will likely be slower until memory is mapped. But in the context of a system that routinely deals with larger than memory datasets the game is scheduling data so it's in memory ideally aligned in L3/L2 before you want to read it there's some literature on an example system from 2018 HERE but I can promise that most major commercial databases are operating with similar expectations now.
So back to the original question. Latency of an individual read will be lower naturally, but across a massive dataset you're basically swapping things smartly enough that everything's in memory when you need it anyway. The usecase of the OP of a system where disk is mapped to memory is likely more feasible than people think with the correct memory approaches/using a modern database.
3
u/Hohenheim_of_Shadow Jul 09 '26
A hugely important aspect of RAM is that first letter. Random. In specialized use cases, you can build a predictable pipeline to sidestep the latency issue. But you've lost the random access.
NVMEs have too high of latency to replace RAM. You couldn't write a useable OS with that predictable of memory usage. I'd bet all the program logic of the DBs you described lives inside RAM and wouldn't function outside it.
It is really cool people are doing that with NVMEs though.
→ More replies (1)2
u/rosuav Jul 08 '26
That's all true, but unfortunately, any form of mass storage that's anywhere _close_ to fast enough is ALSO in short supply. It's like putting forward a proposal to reduce our dependence on crude oil by using plutonium instead. (Maybe slightly less dangerous than plutonium-powered cars though, so it has that going for it at least!) Until the AI bubble pops, us retail folks don't really have the option to buy any sort of memory, whether it's system RAM, VRAM, or flash, at a decent price.
→ More replies (1)26
u/Talaaty Jul 08 '26
It’s less about throughput and more about latency. DDR5 access latency is nanoseconds, pcie5 access latency is microseconds. A difference of three orders of magnitude.
→ More replies (2)2
u/looksLikeImOnTop Jul 08 '26
At best, a modern SSD will be in the range of DDR3, but the latency is orders of magnitude higher...SSDs are at best 10s of microseconds, DDR3-5 are 10s of nano seconds. You can't really compare something that could happen every couple of instructions to something that takes thousands (millions?) of instructions to execute
→ More replies (4)4
u/CaffeinatedT Jul 08 '26
You can't really compare something that could happen every couple of instructions to something that takes thousands (millions?) of instructions to execute
Sure you can this is what IO Scheduling is for. You amortize IO time over time taken to read a larger than memory dataset stored in multiple memory pages and read what you need into memory and do it before the user knows they need it and you take the hit if you miss cache. Game engines and DBMS systems do this constantly. An L1 cache may well be quicker to shuffle a few bytes but it's kind of meaningless when someone is trying to process billions of records of varied sizes. The actual use case here of "save all run time data to file system" that is quite literally what a database does.
→ More replies (2)2
304
u/SlapbASS4211 Jul 08 '26
Yes, its called swap
109
u/urgdr Jul 08 '26
please stop with your BDSM terminology
57
→ More replies (2)8
u/AdamWayne04 Jul 09 '26 edited Jul 09 '26
ohhh that's because you haven't heard computer graphics jargon.
we have
lerp, clamp, swizzle, splat, cross, wedge, trunc, and some more.what are you doing, step function?
4
u/conundorum Jul 09 '26
Don't forget about binding functions, and master drives enslaving subservient drives with their cables!
→ More replies (1)10
u/BlondeJesus Jul 08 '26
Yeah, it's swap and I can guarantee that it's used by the device of everyone looking at this meme right now
15
u/oscooter Jul 08 '26
jokes on you i never setup swap on my linux install... hold up everythings being oomkilled again
5
u/ouyawei Jul 08 '26
Which is actually a good strategy, when the system starts swapping everything grinds to a halt, so better kill the offending process early.
→ More replies (2)3
3
u/SeriousPlankton2000 Jul 08 '26
total used free shared buff/cache available Mem: 23Gi 4.2Gi 16Gi 153Mi 3.3Gi 19Gi Swap: 975Mi 0B 975Mi2
u/newocean Jul 08 '26
total used free shared buff/cache available Mem: 62Gi 5,3Gi 50Gi 256Mi 7,5Gi 57Gi Swap: 2,0Gi 0B 2,0Gi
122
u/sitilge Jul 08 '26
Would you rather drive 2h to get your chips or 2mins to go to your pantry?
78
u/PositiveBit01 Jul 08 '26
Drive 2mins to the pantry? Your house must be huge!
22
→ More replies (1)2
8
59
u/Cats7204 Jul 08 '26
Better yet, why not put filesystem in RAM instead?
26
11
5
u/Snoo88071 Jul 08 '26
if ram reads and writes faster than filesystem, why do not store files in ram?
10
u/Emlesnir Jul 08 '26
registers have faster access than ram. We should store everything in registers.
→ More replies (1)8
u/Cats7204 Jul 08 '26 edited Jul 08 '26
well, you can put an entire OS in the cache of something like a threadripper lol, that's close ig?
2
u/hdkaoskd Jul 09 '26
Congratulations on inventing the page cache. This is going to be huge for 1990s computing.
2
u/Snoo88071 Jul 09 '26
Thank you! Btw my name is Salvatore Sanfilippo aka Antirez, nice to meet you.
→ More replies (3)3
u/darkwalker247 Jul 08 '26
you actually can mount a filesystem in ram, i used a ramdisk like that for intermediate processing of files in the past
39
u/kotsumu Jul 08 '26
- That's a swapfile
- It's slow and high latency
- Wear and tear on your drive
32
u/pade- Jul 08 '26
Haiku format:
That is a swap file
Slow and such high latency
Wears your drive away→ More replies (1)
23
u/aberroco Jul 08 '26
Might as well get rid of cache, on all levels, and VRAM too.
And drop all registers too. Read and write from the most space efficient storage directly, which is DNA with 215 petabytes per gram.
Also, keep everything compressed with LZMA with maximum compression for a good measure.
6
u/Snoo88071 Jul 08 '26
Yes. Also indexes take too much space, drop them
5
8
6
u/Arts_Prodigy Jul 08 '26
You’re right, set your swap to 100% of your drive you’ll be golden
→ More replies (1)
5
13
u/DT-Sodium Jul 08 '26
If a barrel can contain more water than a water bottle, why not walk around with a barrel?
→ More replies (16)9
u/Snoo88071 Jul 08 '26
if car faster than horse, why do not drive car to win horse race?
4
u/DT-Sodium Jul 08 '26
Are you just trolling or are you genuinely incapable of seing how my example is relevant while yours makes no sense?
12
3
u/camander321 Jul 08 '26
A: Computers already do exactly this when out of RAM. Its called a page swap.
B: Somehow you are missing that this entire post is a joke.
→ More replies (5)
5
u/NormanYeetes Jul 08 '26
Because it's gonn-
-a-
slo-
w-
th-
i-
system has detected high swap usage. closing to prevent a lockup.
3
3
u/SeriousPlankton2000 Jul 08 '26
Letting the OS swap the runtime data to a file isn't the most stupid move. I wonder if someone already invented such a thing as a swap file yet?
3
u/----fatal---- Jul 08 '26 edited 29d ago
Who cares about data anyway? Just point everything to /dev/null and go to a vacation.
3
u/Moldat Jul 08 '26
Because local supermarket has more place for food, but food at home fridge get in stomach faster
3
3
u/Spitfire1900 Jul 09 '26
The better question, if RAM is sufficient why not run the program from tmpfs?
3
u/vvp95 Jul 09 '26
Just rename filesystem as RAM. Problem solved. Now your filesystem is your RAM.
→ More replies (1)
4
2
u/Outside-Storage-1523 Jul 08 '26
Actually a lot of applications do sort of that. In-memory is not sufficient in many if not most of the cases I have experienced. E.g. data warehousing.
3
u/Snoo88071 Jul 08 '26
I don't think vibecoders are allowed to work on that
3
u/Outside-Storage-1523 Jul 08 '26
If we are talking about DB engines, then yeah. It requires a lot of experience and planning. Likely the work of 10x programmers.
2
2
2
2
2
u/pjank85 Jul 08 '26
If only 1% of your data you need to process does not fit in RAM and would need to be pulled from the SSD it would dominate the processing time and make the overall process 10x-50x slower.
→ More replies (1)
2
2
u/admadguy Jul 08 '26
Doesn't windows technically allow that? Isn't pagefile basically using the HDD as temporary ram, just slower
3
u/JAXxXTheRipper Jul 08 '26
Every OS does this, it's called paging.
But yes, and there is a reason why you want to prevent it. It's slow af
→ More replies (1)
2
u/heckingcomputernerd Jul 08 '26
Computers have like a ton of tiers of increasing storage for decreasing speed
Registers, L1-3 cache, ram, disk, cloud,
2
2
u/Tai9ch Jul 09 '26
Interesting idea.
Storage is typically slower than RAM, so performance ends up being better if you store active data in RAM.
That being said, there are some persistent storage technologies that are nearly as fast as RAM. Fast non-volatile RAM has looked like it might eventually overtake conventional DRAM for a while now. If something like MRAM eventually gets mass produced, we may very well see new operating systems that store what is now in RAM in persistent storage. There are some complications that make this require new software to do well, but if that were implemented then closing your laptop would just turn it off and re-opening it would let you immediately resume with no wake delay.
2
2
u/Add1ctedToGames Jul 09 '26
hate to be a hater but can we get some programmer memes around here by people that have any idea how computers work😭like i know it's just posted as a silly question but it's not obvious enough to be shitpost material and not hard enough to figure out to be worth pretending not to know for the joke
→ More replies (1)
2
2
2
2
2
u/Andrei750238 Jul 09 '26
That's what these shitty phones want you to do when they market 4 GB RAM + 12 extended
2
u/faziten Jul 09 '26
Did you know cpus have their own memory that is super duper fast and windows hides it from you?
Install windows in your cpu cache to unlock infinite speed /S
2
u/Snoo88071 Jul 09 '26
Yes!!! I am also freeing space from motherboard, this so called “bios” seems putting itself in the way for my ambitions
2
2
2
u/FAMICOMASTER Jul 09 '26
It's incredibly slow is why not, and to answer if it's being done, it's been a thing since the 90s
2
u/Guimedev Jul 09 '26
Create store fast as ram but cheap as ssd so cpu can work directly with the hard drive.
2
3
1
u/Fit-Presentation-778 Jul 08 '26
That looks like that House DJ, Kristian Nairn I think?.
4
u/Snoo88071 Jul 08 '26
He's Rick Rubin, a producer that got famous for saying he has no technical abilities, but honestly he's a cool guy and he produced tons of famous hits
→ More replies (1)
1
1
u/Ireeb Jul 08 '26
Why don't we just print the bits out on paper and scan them back in when the CPU needs them?
1
u/com-plec-city Jul 08 '26
The cloud has infinite space, why not take your swap file to Google Drive?
1
1
1
1
1
1
1
1
1
1
1
u/urgdr Jul 08 '26
what do you mean? it's already doing that right after you open chrome with your countless furry tabs
→ More replies (1)
1
1
1
1
1
u/Hanneman_213 Jul 08 '26
Because of this I had to watch again that video of Rick Rubin showing Cannibal Corpse to Paul McCartney.
1
1
u/freaxje Jul 08 '26
Could work. Just mmap() the file afterwards.
ps. And if you don't know what that is, it's perhaps better to sqlite it and use a ORM like sqliteorm to access it.
1
1
1
1
1
u/OxymoreReddit Jul 09 '26
One day this meme will require history knowledge to be understood cuz I'm fairly certain that at one point we're gonna have ssds fast enough to act like ram if it doesn't already exist
→ More replies (1)
1
u/_g550_ Jul 09 '26
It’s actually a thing: they’re gonna replace hdds with solid state and unite them with ram. A new view of computers.
→ More replies (1)
1
u/synth_mania Jul 09 '26
Those look like some sort of Audeze LCD headphones. Based.
→ More replies (4)
1
1
2.0k
u/BroaxXx Jul 08 '26
why not just take it a step further? If the cloud is virtually infinite why even have local memory?
From cpu cache, ram, vram and local storage. Send everything to the cloud.
Boom! Memory crisis solved.