%%
date:: [[2022-09-29]]
Parent:: [[Performance|Application Performance]]
%%
# [[Speed]]
Speed is the rate at which an activity is done. It is how quickly something is processed or completed.
In [[Performance|Application Performance]], "speed" commonly refers to one of the following aspects:
- [[Latency]]
- [[Throughput]]
- [[Parallelism]]
## Throughput vs. latency vs. parallelism
These terms are sometimes used interchangeably when explaining that something is "fast", but they are distinct concepts.
Imagine a baker named Pierre [^brilliant] who wants to make as many cakes as possible. If someone asked you to measure how fast Pierre is at making cakes, what would you measure?
You could measure the amount of time it takes him to do everything he needs to bake a cake:
- Measuring ingredients
- Mixing ingredients
- Putting them in the oven and waiting
- Cutting slices to serve
If you time how long it takes to do all of these for one cake, you'll end up with a measure of how long the entire process takes. This is *latency*.
Pierre is an experienced baker, though. He knows that he's probably going to sell more than one cake today, and he knows that more than one cake fits in the oven. So he's actually [[Batching]] the activities and doing them for *two* cakes instead of one-- so he mixes twice the nuimber of ingredients and bakes them together. While he's waiting for the oven to finish baking, he's already starting on the next cakes.
Another way to measure how fast Pierre makes cakes is to measure how many cakes he can finish baking in a certain amount of time. Let's say Pierre can bake 4 cakes an hour. This is Pierre's *throughput*.
At this point, you're only measuring how fast Pierre is. But what if Pierre hires assistant bakers, each of whom has their own oven to work with? What if you measure how many people are making cakes at the same time? This is *parallelism*.
And what if you measure how many cakes the entire bakery can produce in an hour? This is *total throughput.*
[^brilliant]: Brilliant. (2022). _Is Pierre making pastries faster?_ Retrieved from https://brilliant.org/courses/computer-science-essentials/computational-problem-solving-2/parallelism/5 .