32
cache (lemmy.dbzer0.com)
top 5 comments
sorted by: hot top controversial new old
[-] argv_minus_one@beehaw.org 2 points 2 years ago* (last edited 2 years ago)

Finding clothes on a chair isn't constant-time. You have to search through the heap of clothes to find the item you want. It has the same time complexity as searching through the closet; it's only fast because n is small.

[-] omenmis@beehaw.org 0 points 2 years ago

It takes 2 pause cycles, that's essentially O(1) compared to a cache miss.

[-] jcg@halubilo.social 1 points 2 years ago* (last edited 2 years ago)

You could implement in-closet indexing instead to make the cache misses hurt less, trading off some extra insertion time but needing less memory for the cache which is much more expensive cost wise. At this point you're storing almost your whole DB in the cache and your room's a mess.

[-] SpezCanLigmaBalls@lemmy.world 1 points 2 years ago

I’ve been subscribed to this subreddit for years and so much shit is way over my head lol

[-] Valmond@lemmy.mindoki.com 1 points 1 year ago

O(k) time to be pedantic, where k is the number of layers.

this post was submitted on 16 Jun 2023
32 points (100.0% liked)

Programmer Humor

19843 readers
214 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS