Mike's post is good and I enjoyed it. The benchmarks are interesting. I started writing a reply to this email thread, but it kept getting bigger and bigger! I decided to post my reply here instead:
http://www.onebigfluke.com/2015/02/asyncio-is-for-composition.html 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. :) Otherwise, I'm curious what low hanging fruit in the library could be identified with some more profiling (and what fruit has already been plucked?). -Brett 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 >
