Issue 425
令机器学习投入生产 原文: PyCoder’s Weekly - Issue #425 200617 Zoom.Quiet(大妈) 用时 42 分钟 完成快译 200617 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄. 令机器学习投入生产 VICKI BOYKIS Millions of web apps get deployed to production every day. But machine learning models aren’t web apps. And very few people are talking about deployment. Learn how tools like Streamlit can help take the edge off deploying your machine learning models. Python 生成器介绍 REAL PYTHON course In this step-by-step course, you’ll learn about generators and yielding in Python. You’ll create generator functions and generator expressions using multiple Python yield statements. You’ll also learn how to build data pipelines that take advantage of these Pythonic tools. (是也乎: ) 皮尤研究中心的 Python 库 PATRICK VAN KESSEL The Pew Research Center’s Data Labs team has open sources two Python libraries for wrangling files and cleaning up text documents. (是也乎: 目测, 这个研究库, 马上将被和谐. ) 异步 Python 并不快 CAL PATERSON Performance optimization is a tricky subject and silver bullets are rare. This article shines a light on some of the common misconceptions around async Python, like “async is always faster.” Related discussion on Hacker News. (是也乎: 初学者困境… 就是非常容易被这种看似公允的测试说明相信一个断言. 真实场景中: 1、异步 web 服务器不可使用 reverse proxy,因为 async server 性能高于 reverse proxy。瓶颈位置在 reverse proxy 和 wsgi 层而非 web server。使用 reverse proxy 是因为多线程 context 切换成本高,开不了很多,所以需要一个能无限开 context 的异步服务器(nginx)挡在前面。而本身异步的服务器不需要。 2、异步 web server 不可使用 connection pool 和消息队列,因为无论是协程还是纯单线程异步,协程数和连接数都用不完。由于不存在多线程或者多进程的 context 切换成本,导致只能起有限的线程数,所以需要连接池。异步的连接数用不完,所以不需要连接池,否则会成为瓶颈。 3、异步服务器在并发数超过 1000 时才会明显体现出来,sync 服务器即使在使用 reverse proxy 的情况下由于中间的代理损耗也很难处理 1000 以上的并发。我在对异步服务器做性能测试的时候,是测试程序先挺不住,真实测试异步服务器的性能的技术含量不低,初学者做不到。 这篇作品槽点太多,先说以上几点。一个个讲过来,要打一天的字。 <– 摘录隔壁群中对此文章的部分观点. 简单说, 对异步和协程的理解, 文章测试出发点就有问题. ) ...