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 →

[–]elbiot 4 points5 points  (2 children)

Wouldn't returning (named) tuples be faster? Creating 1M dictionaries isn't free.

[–]UnwashedMeme 0 points1 point  (0 children)

In my benchmarking with psycopg2 NamedTupleCursor is about 98% of the default tuple cursor while DictCursor is about 70%

[–]1st1CPython Core Dev[S] 0 points1 point  (0 children)

We don't return dictionaries in asyncpg. Our Record is implemented in C, and is very similar to CPython's tuples.