[docs] [issue10160] operator.attrgetter slower than lambda after adding dotted names ability

Raymond Hettinger report at bugs.python.org
Thu Oct 21 04:04:14 CEST 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

Thanks for noticing this.  I wasn't aware that it had slowed down after dotted name support had been added.

Since it is a mild performance issue, I'm lowering the priority.  Will take a further look when I get the chance.  A first look at the patch shows that it is bigger than I expected.  Isn't it possible to check for a dot on construction and just record the boolean so that a fast, non-splitting path can be used.

I'm reluctant to make the code volume grow much for this function.  It is already a bit voluminous for the minor convenience it offers.

----------
priority: normal -> low
stage:  -> patch review
type:  -> performance

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10160>
_______________________________________


More information about the docs mailing list