Re: [Zope-dev] SVN: Zope/trunk/ Optimized the `OFS.Traversable.getPhysicalPath` method to avoid excessive amounts of method calls. Thx to Nikolay Kim from Enfold

2011-07-14 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/14/2011 04:16 AM, Hanno Schlichting wrote: Log message for revision 122213: Optimized the `OFS.Traversable.getPhysicalPath` method to avoid excessive amounts of method calls. Thx to Nikolay Kim from Enfold Changed: U

Re: [Zope-dev] SVN: Zope/trunk/ Optimized the `OFS.Traversable.getPhysicalPath` method to avoid excessive amounts of method calls. Thx to Nikolay Kim from Enfold

2011-07-14 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/14/2011 11:47 AM, Tres Seaver wrote: While we're at it, 'list.insert(0,foo)' is known to be slower in a tight loop than 'list.append(foo)', with a 'reversed' at the end of the loop:: $ python -m timeit -s from string import letters path =

Re: [Zope-dev] SVN: Zope/trunk/ Optimized the `OFS.Traversable.getPhysicalPath` method to avoid excessive amounts of method calls. Thx to Nikolay Kim from Enfold

2011-07-14 Thread Hanno Schlichting
On Thu, Jul 14, 2011 at 7:03 PM, Tres Seaver tsea...@palladion.com wrote: A further micro-optimization is to pre-allocate a big list in a thread local.  Running the attached script produces::  $ python perftest.py  Via insert_0: 24.8401839733  Via append: 15.6596238613   speedup: 37.0%