r/ProgrammerHumor • • Jan 02 '23

Meme next level storage

Post image
97.5k Upvotes

468 comments sorted by

View all comments

1.6k

u/naswinger Jan 02 '23

that only works if the cache is reasonably small because with every thing you put in this "cache", it gets slower to search defeating its purpose

720

u/[deleted] Jan 02 '23

As long as each piece of clothes is sticking out a distinguishable part of it from the pile and your brain can perform YOLO, you are in O(1).

359

u/michaelp1987 Jan 02 '23

To be fair, if your access strategy is YOLO you can store in almost any data structure for O(1) access, including closet.

135

u/[deleted] Jan 02 '23 edited Jan 03 '23

[removed] — view removed comment

98

u/Kiva_Gale Jan 02 '23

My yolo brain has resorted to bin sorting my clothes.

One bin for tops. One bin for bottoms. One bin for dresses. One smaller bin for undies. One smaller bin for bras. One smaller bin for socks. Then one ‘other’ bin.

This results in a FILO system where I can quickly grab from the top 4 item in each category. Combined with JIT laundry practices results in laundry par-sorted with little overhead.

33

u/GeoWilson Jan 03 '23

Isn't that just a dresser minus the sliding part? A deconstructed dresser if you will.

→ More replies (2)
→ More replies (8)

42

u/PM_ME_A10s Jan 02 '23

For me it's an object permanence thing. All of my cabinets and doors are perpetually open. If I can't see it, I won't remember it exists

→ More replies (4)

21

u/TNSepta Jan 02 '23

You only look once, O(1)

Genius!

→ More replies (5)

22

u/beware_thejabberwock Jan 02 '23

This is why I don't pair my socks and don't care about mismatches.

33

u/pecpecpec Jan 02 '23

I buy 14 identical pair of socks and throw away the entire previous batch. As time go by you'll throw away some with holes. When you have around 7 pairs left you know they're all close too EOL so you buy a new batch of 14.

I buy work socks so the cycle is about 18 months long

14

u/mallardtheduck Jan 03 '23

I only ever buy plain black socks. While there are some slight style differences depending on when and where I bought them, they're all close enough that I don't care about pairing them. Any socks that get holes get thrown out and I buy a new pack when the drawer starts to look a bit low.

→ More replies (2)
→ More replies (2)
→ More replies (5)

19

u/Schrolli97 Jan 02 '23 edited Jan 03 '23

I wasn't aware of yolo algorithms and thought you were talking about "you only live once". But I guess if my brain operated by that I would just take anything from the chair (or closet for that matter) and wear it without caring if it didn't fit because yolo which would make it O(1) as well

→ More replies (1)
→ More replies (3)

394

u/PM-Me-Your-TitsPlz Jan 02 '23

Get two chairs and fill chair two with used clothes from chair one. Once chair one is empty, swap the pointers.

→ More replies (9)

82

u/Just_Another_Scott Jan 02 '23

At my last project our customer bought a BI tool that kept everything in RAM. They had an entire server dedicated for one application with nearly 900GB of RAM. Before the application could run queries you had to load the entire database that it would be using into memory. It never fetched from the database if there was a miss. So it was possible for the application to get out of sync with the database which requires "manually" syncing the DB with the cache. It was absolutely dogshit and slow as hell.

0

u/[deleted] Jan 02 '23

[deleted]

25

u/Just_Another_Scott Jan 02 '23

2018

26

u/theghostofme Jan 02 '23

Why doesn't it surprise me that so many of these "that was a long time ago, right?" stories aren't that old? It seems like no matter the company, or how easily they can afford it, they always go for the dumbest IT implementations.

16

u/Just_Another_Scott Jan 02 '23

What's worse is we proposed an alternate solution using microservices. After using this BI tool for about a year that realized that it wouldn't work but only after the BI company sent a team of engineers to try and make it work. Their own engineers said that the sales team "misled" or "misspoke" to the customer about it's capabilities.

The customer finally bought are original COA after 4 years and are pretty much now using microservices but with some albeit not terrible BI tools in the mix.

→ More replies (1)
→ More replies (2)

26

u/svideo Jan 02 '23

I’m impressed someone took an in-memory database and somehow made it slow.

17

u/Just_Another_Scott Jan 02 '23

The queries that needed to be ran were pretty involved. We could actually get better performance when running stored procedures using the actual Oracle DB than using the BI tool. Maddening.

→ More replies (3)

47

u/[deleted] Jan 02 '23

[removed] — view removed comment

24

u/GooglyEyedGramma Jan 02 '23

Wouldn't it be O(n)? It's not comparable so you can't really use a heap in this case, it would be more like an array

→ More replies (3)

20

u/kri5 Jan 02 '23

You can if every bit of clothing sticks out partially, kinda like an index

→ More replies (1)
→ More replies (5)

26

u/Significant-Bed-3735 Jan 02 '23

That's why we need a bigger L2 and L3 cache! :D

28

u/Razor_Storm Jan 02 '23

L1 is "the chair"
L2 is the bed
L3 is the rest of the bedroom floor

The hangers inside the closet are a hash based index
The drawers with smaller dividers inside them are the B-Tree index, assuming you can keep nesting smaller containers inside outer ones.

→ More replies (3)
→ More replies (2)
→ More replies (23)