Hugh Brown added the comment:
Mariatta:
Yes, that is what I was thinking of.
That takes my 12 execution time down to 10 seconds. (Or, at least, a fix I did
of this nature had that effect -- I have not timed your patch but it should be
the same
Hugh Brown added the comment:
Fabulous. Looks great. Let's ship!
It is not the *optimal* fix for 3.x platforms. A better fix would calculate the
set of fieldnames only once in __init__ (or only as often as fieldnames is
changed).
But I stress that it is a robust change that works in ver
Hugh Brown added the comment:
I came across this problem today when I was using a 1000+ column CSV from a
client. It was taking about 15 minutes to process each file. I found the
problem and made this change:
# wrong_fields = [k for k in rowdict if k not in self.fieldnames