Grokking Concurrency in Python
Vote

0% completed

​

IO Bound Work, Asyncio or Threads

A thousand threads fetched a thousand pages from Harvest's test site in 0.68 seconds. A thousand asyncio tasks fetched the same pages in 0.70 seconds, so asyncio was not faster. The two versions differed in other numbers: the thread version needed 95 MB of memory at its peak against 59 MB, and it used more CPU time, but only at the higher level of concurrency.

The Same Fetch, Written Twice

A fair test changes only the model. The `urllib

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content