5 ms·
If you are operating in an environment with asyncio check out asyncpg - https://github.com/MagicStack/asyncpg https://github.com/MagicStack/asyncpg Performance
by whalesalad 2y ago
If you are operating in an environment with asyncio check out asyncpg - https://github.com/MagicStack/asyncpg https://github.com/MagicStack/asyncpg
Performance charts speak for themselves. This lib uses the binary protocol while most are using text based comms.
- odie5533 2y agoWhy is asyncpg so much faster?
- whalesalad 2y agohttp://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/ http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python...
- odie5533 2y agoFrom reading that, it's still unclear to me why asyncpg is faster than async psycopg3.
- whalesalad 2y ago> Unlike psycopg2, asyncpg implements PostgreSQL binary I/O protocol, which, aside from performance benefits, allows for generic support of container types (arrays, composites and ranges).
- alanwreath 2y agoAny lineage between these two libraries? Any reason to mention it here other than being a different driver?
- whalesalad 2y agoThey are unrelated lineage wise, but accomplish similar things. One just happens to be substantially more performant than the other. I have been a psycopg user for many years but have started to utilize this lib in projects that rely on asyncio.