first generation
All checks were successful
beefhavers/queue-theory/pipeline/head This commit looks good

This commit is contained in:
adam 2025-04-05 23:34:38 -04:00
parent d88bec726f
commit b7f5bc53be
14 changed files with 66 additions and 0 deletions

BIN
Sounds/VO/altVO.wav Normal file

Binary file not shown.

BIN
Sounds/VO/primaryVO.wav Normal file

Binary file not shown.

BIN
notes/note1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
notes/note2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
notes/tc1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

BIN
notes/tc2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

BIN
notes/tc3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

BIN
notes/tc4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

BIN
notes/tc5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

BIN
notes/tc6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
notes/tc7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

BIN
notes/tc8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

3
script-altVO.txt Normal file
View File

@ -0,0 +1,3 @@
'MURICA
"it takes 2 hours to do a load of laundry, washes and dries it for you. Now, I have a washer, and a dryer. takes 1 hour to wash 1 hour to dry. Which one of these is faster at doing laundry?"
Markovian<br />Markovian<br />c servers

63
script-primaryVO.txt Normal file
View File

@ -0,0 +1,63 @@
They say brits love to queue. out here in
we are very, very bad at it. There's a complete branch of mathematics dedicated to studying queue theory, though I imagine niether you nor I have a math degree. But we don't need one to do it right.
I'm stealing this metaphor from Casey Muratori.
Casey goes on to explain that you can gain performance by overlapping work within a pipeline.
Now. Imagine you are the laundry.
Your goal is to get through the wash, ideally as quickly as possible. So you wait in line for the washing machine, and then wait in line for the dryer.
Even though the line for the dryer is shorter, you still have to go wait in line for the wash first.
The point of this metaphor is that the other, shorter line is an illusion. All of the laundry has to go through "the laundry room" as a whole.
Since the world is hellbent on doing everything the most wrong way possible, here's what we do instead.
on airlines, you pay more to sit earlier. which is silly to me, you still have to wait for the cheap seats to board before the plane takes off. The only difference is that now your whole boarding process is slower, and you've burned more money to have to leave the airport bar earlier.
In a grocery store, what arises naturally is 1 line per register. This allows you to try and change lines if you think it'll get you up to the register faster.
If you're the gambling type.
There's a better way. Let us assume the following:
* no customer is entitled to get through the line faster than any other.
* every server is equivalent.
There's a better way to do this: It's called an M/M/c queue. You arrive, whatever server is available handles you, and you're gone. This does mean that instead of looking at 2 lines, you look at 1 line that has twice as many people in it. But it also means that a line twice as long moves *at least* twice as fast.
Which is why bank tellers tell you to wait in line for them to be ready.
Even better than that, suppose you have more tellers than registers. If you're at a bar and most people have a tab running, you can have a server sign in, find your tab, add your drink to it, and then sign out, freeing up that register while they pour the beer. This way with 3 staff and 2 machines,
the math is calculated with 3 "service nodes" instead of 2.
Additionally, having more people than machines rotating around provides a signal that we're doing it the efficient way.
Let's imagine an average bar in a cursed city.
...maybe a mediocre bar.
Let's imagine 20 people want beer, there are 2 registers, and 3 bartenders.
First, let's do it right.
20 people start filling out the singular beer line.
a bartender summons the customer at the front of the line to the register. He takes the customer's order. Keys it in. Goes to start filling beer. Once the order is taken, the register is free for another bartender while the glass is being poured, so the customer shifts out of the way while waiting. repeat, 20 times.
Now, let's see what results when people think they're smart.
the first person to have to wait in line picks a register. possibly at random, possibly through some assumption about which would be faster.
The second person sees a register has 1 person in line, another register has 0, so he gets in line for register 2.
soon we have 2 lines of 10.
Every single delay in each line is compounded through the entire line - line 1, guy drops his credit card before handing it over? add a second to the wait time for everyone behind him. Another guy needs to count out coins? add 3 minutes for everyone behind him. Register 2 falls off the internet and has to reconnect? add 5 minutes for everyone in line 2.