PacktPublishing / Asynchronous-Programming-in-Rust

Asynchronous Programming in Rust, published by Packt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification in "parallels to process economis"

Tudyx opened this issue · comments

In chapter 1, Concurrency versus parallelism , "Let's draw some parallels to process economics" , "Alternative 3", it's written:

[...] you calculate that they now only just over 20 seconds on an order. You've basically eliminated all the waiting. Your theoretical throughput is now 240 beers per hour.

If its 20 seconds per hour, the theoretical throughput shouldn't be (60 * 60) / 20 = 180 beers? Am I missing something?

Hi @Tudyx. You've not missed anything.

You just caught a mistake that I'm frankly embarrassed that I didn't catch myself on one of the many proofing passes on the book. Very observant of you, and thanks for reporting it.

In the first version of the example, I used 10 + 5 seconds for pouring and topping up the beer (60*60) / 15 = 240. I later changed it to 15 + 5, making the whole process take exactly 2 minutes, so it's easier for readers to do the math in their head.

Apparently, I failed to update the actual calculations for alternative 3 and 4 to reflect that.

Fortunately, the exact numbers are not the most important part of the analogy, which is probably why neither I nor the reviewers caught this in one of our many passes. I can only assure you that it doesn't reflect the work that's gone into ensuring the quality of the rest of the book.

The correct numbers should be:

Altnernative 3:
Theoretical throughput: 180 beers/hour
With an additional bartender, you'll have the same theoretical throughput as you had with 12 bartenders.
Actual throughput: 150 beers/hour.

Alternative 4:
Actual throughput 170 beers/hour each, giving a total throughput of 340 beers/hour.

I'll have to go over the numbers and the corresponding text once more when I have a little more time since it's very late where I am right now, but I will add it to the errata of the book.

I apologize for this mistake, and I hope it doesn't detract from the underlying message I wanted to convey with this analogy.

Thank you for your quick answer and the erratum. Don' t worry, as you said the most important part was the analogy, which is very good by the way.
I'm only at the beginning of the book, and I'm enjoying the journey so far.