On Tue, Feb 17, 2015 at 5:53 AM, Brett Slatkin <[email protected]> wrote: > http://www.onebigfluke.com/2015/02/asyncio-is-for-composition.html
Mike's post and your response together are awesome. Thanks for sharing your thoughts! > I'd love to hear if people on this list agree or disagree with my reasoning. > Perhaps the real problem here is the goals of asyncio aren't understood well > enough by most Python programmers out there? Or maybe I'm wrong. :) I believe a lot of the perception of the goals of asyncio are influenced by the hype over Node.js. For Node.js raw performance is *the* selling point. I think of Node as a Formula 1 car: really fast but unreliable and painful to drive. None of these attributes I consider Pythonic (although no one would complain if Python was "really fast"). Best, Luciano > > > > On Mon, Feb 16, 2015 at 3:05 PM, Victor Stinner <[email protected]> > wrote: >> >> Hi, >> >> Mike Bayer, the author of SQLAchemy, wrote a long article about >> asyncio and databases: >> http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/ >> >> IMO the most interesting part if the benchmark written for this article: >> https://bitbucket.org/zzzeek/bigdata/ >> >> The benchmark inserts a lot of rows (more than 9 millions) in a >> PosgreSQL server using psycopg2 and aiopg. It compares performances of >> threads, gevent and asyncio. Bad news: asyncio is much slower on this >> benchmark (between 1.3x and 3.3x slower). >> >> It's not easy to create the setup to run the benchmark (ex: you have >> to install a PostgreSQL server and configure it to run the benchmark), >> you have to find the best pool size for your setup and then you have >> to analyze bencmark results (there is no unique number at the end, >> just a long list of numbers). On my first setup (desktop: benchmark, >> laptop: server, slow LAN), I had to stop the benchmark after 2 hours. >> >> Mike see between 6,000 and 26,000 SQL INSERT queries per second >> depending on his setup and on the benchmark parameter. Ah yes, there >> are also options to tune the benchmark, but I don't think that you are >> supposed to use them. >> >> I'm trying to reproduce the benchmark to check if I get similar >> results and then to try to run asyncio in a profiler. I never used >> aiopg, nor psycopg2, and I don't remember when I installed a >> PostgreSQL server for the last time :-) >> >> Victor > > -- Luciano Ramalho Twitter: @ramalhoorg Professor em: http://python.pro.br Twitter: @pythonprobr
