Am 20.09.2016 um 02:29 schrieb raf:
Christoph Zwerschke wrote:
I think so. But it may point to a performance degradation elsewhere, so I'd
like to check this. Did you forget to attach the test?

Oops. Sorry about that. Here it is.

Thanks a lot.

I had a look at this and can confirm that there is a severe performance degradation. This has nothing to do with the array parsing, but with the new version returning named tuples instead of tuples. The problem is that the named tuple classes are created for every query (because they depend on the column names), and the creation of such a type takes a significant amount of time. I tested again with a simple cache for the row types, and there was no significant degradation any more. So I will add a type cache for row types into the next version if nobody comes up with a better idea.

I have also added a way to deactivate the casting of arrays to lists:
In the trunk you can not wo: set_typecast('anyarray', lambda v, c: v)

-- Chris

PyGreSQL mailing list

Reply via email to