Re:Show HN: 1M rows/s from Postgres to Python
by RedCrowbar on Thursday August 04, 2016 @07:08PM
(#12229087)
> that's great, you've written a very fast driver. My benchmarks are comparing psycopg2 to itself,
OK, I ran the asyncio suite (with uvloop event loop):
Python3.5.2 asyncio+psycopg+uvloop -- avg 8356.84 recs/sec
Really not that slower. There is also an important detail that you forget to mention: the threaded benchmark uses notably more CPU time (about 30% more).
It's not that the latency of asyncio is really that big of a deal. The point I try to make is, asyncio != speed. For databases, 95% of the time, it means, a little less speed. Not a big deal, but if you aren't into writing explicit context switching directives throughout 100% of your code when the OS does it for you just fine, it isn't worth it, unless you are in the zone of thousands of arbitrarily performing connections, which is really more of an incoming client connection thing, not usually a database thing.