On Tue, 17 Feb 2015 00:05:07 +0100
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).

Are you surprised? A coroutine trampoline + event loop written in
pure Python will always be much slower than native syscalls + native
stack unwinding by the CPU itself.

Regards

Antoine.


Reply via email to