Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You Don't Care About Efficiency

214c694acb154321379cbc58dc91528c?s=47 Cory Benfield
September 06, 2015

You Don't Care About Efficiency

In this talk we’ll discuss why synchronous software is a problem, what your options are to move away from it, and what challenges are being faced by the Python ecosystem as we try to move towards a brave new asynchronous world.


Cory Benfield

September 06, 2015


  1. You Don’t Care About Efficiency

  2. Hi

  3. @lukasaoz @lukasa

  4. None
  5. Requests Core Contributor urllib3 Core Contributor Maintainer of 10+ others

    Hyper Maintainer
  6. You Don’t Care About Efficiency

  7. Synchronous Code is Dying

  8. None
  9. The Problem

  10. Thesis: Synchronous Code is Hurting Software

  11. None
  12. Why Is Software Slow?

  13. Responsiveness

  14. Synchronous ≡ Inefficient

  15. None
  16. for url in urls: r = requests.get(url) do_stuff_with(r.content)

  17. Why Are We Synchronous?

  18. Easy Tools

  19. How Do I Async?

  20. is Problematic

  21. is Awesome

  22. from concurrent.futures import ThreadPoolExecutor def work(url): r = requests.get(url) do_stuff_with(r.content)

    with ThreadPoolExecutor(max_workers=10) as e: e.map(work, urls)
  23. None
  24. Costs • Unfamiliar paradigms • Framework lock-in • Hard to

    support multiple frameworks (+sync code).
  25. Σ↑

  26. Synchronous Code ≡ Gratuitous Waste

  27. Asynchronous Code ≡ Beautiful Happiness

  28. None
  29. Bonus: A Bold Prediction

  30. Thanks! ✨✨