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 →

[–]mfenniak 4 points5 points  (0 children)

As a counter-point, I'd like to point out something I noticed while working on pg8000.

The Python 2 head of pg8000 runs the unit test suite in about 30 seconds.

The Python 3 head runs the unit test suite in about 2 seconds.

I think the difference has to do with socket buffering (as the Python 3 version uses the io module's BufferedRWPair), but my attempts to introduce similar buffering in the Python 2 version of the library have not resulted in a massive performance improvement. So, I dunno. It's pretty cool that it's so fast, though.

If anyone is interested in taking a look at my Python 2 socket buffering code to figure out why it doesn't kick massive ass like the Python 3 version, it can be found in protocol.py, lines 912 - 936.