[EMAIL PROTECTED] wrote:
Florent Guillaume wrote at 2006-7-5 18:56 +0200:
Is anyone opposed to me removing the stupid:
        _getattr = getattr
        _none = None
        marker = _marker
local namespace """optimizations""" that are found in unrestrictedTraverse?

Why do you think they were stupid?

I call them stupid because they are micro-optimizations that are drowned in the rest of the traversal code and make things harder to read.

_none vs None are exactly the same speed in my tests.
_marker vs a global have a 0.05 microsecond difference on my machine
_getattr vs getattr too.

And if we "localize" those, why not localize aq_base as well, and guarded_getattr and securityManager.validate and nsParse and namespaceLookup...

At least the current unrestrictedTraverse() code has grown sufficiently complex that it should be rebenched and re-optimize if needed, but it's already complex enough to not keep cruft in it if it's not justified.

Florent


They do save time -- although it probably does not dominate the total time.





--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to