简体   繁体   中英

Difference between speed and latency

I think latency refers to execution "speed" when bounded by some time constant (this function cannot take more than X milliseconds to finish execution), but I don't really understand the different between both. Doesn't a faster function have a lower latency? Doesn't lowering the latency increases its speed? Doesn't those concepts imply each other?

I have tried reading definitions of both concepts but haven't really get it yet, so, in order to understand better the difference between both, could you provide a real-world problem where (and why):

  • Trying to increase the speed of a solution increases its latency?
  • Trying to reduce the latency of a solution decreases its speed?

Also, I have the feeling that both concepts are used with slightly different meanings in the world of networking and traditional "execution speed" (in high-frequency trading for example). Is that right?

Real world example where trying to increase the speed of a solution increases its latency

  • You have a racing car and want to make it faster. So you increase the gearbox ratio so that it can go faster for its maximum permissible revs/sec. Unfortunately, that means the car struggles to accelerate and takes longer to get up to speed (worse latency).

Real world example where trying to reduce the latency decreases the speed

  • You want to reduce the latency in responding to requests by adding more parallel workers and sending requests round-robin to different workers. But in so doing each worker that previously had a hot cache no longer does because it didn't deal with the previous request that was nearby in memory so it ends up taking longer (less throughput/speed).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM