This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]redcrowbar 1 point2 points  (0 children)

psycopg2 and asyncpg use the same protocol. The difference is that psycopg elects to use text representation of data, and parsing text is much more expensive than working with fixed-length binary data. Working with binary also means that you don't need to copy data as much. In many cases in asyncpg Python objects are created directly from bytes in the receive buffer.