FSR and unicode compliance - was Re: RE Module Performance

wxjmfauth at gmail.com wxjmfauth at gmail.com
Mon Jul 29 10:20:54 EDT 2013


Le lundi 29 juillet 2013 13:57:47 UTC+2, Chris Angelico a écrit :
> On Mon, Jul 29, 2013 at 12:43 PM,  <wxjmfauth at gmail.com> wrote:
> 
> > Le dimanche 28 juillet 2013 22:52:16 UTC+2, Steven D'Aprano a écrit :
> 
> > 3.2
> 
> >>>> timeit.timeit("r = dir(list)")
> 
> > 22.300465007102908
> 
> >
> 
> > 3.3
> 
> >>>> timeit.timeit("r = dir(list)")
> 
> > 27.13981129541519
> 
> 
> 
> 3.2:
> 
> >>> len(dir(list))
> 
> 42
> 
> 
> 
> 3.3:
> 
> >>> len(dir(list))
> 
> 45
> 
> 
> 
> Wonder if that might maybe have an impact on the timings.
> 
> 
> 
> ChrisA

--------


class C:
    a = 'abc'
    b = 'def'
    def aaa(self):
        pass
    def bbb(self):
        pass
    def ccc(self):
        pass
        
if __name__ == '__main__':
    import timeit
    print(timeit.timeit("r = dir(C)", setup="from __main__ import C"))



>c:\python32\pythonw -u "timitmod.py"    
15.258061416225663
>Exit code: 0
>c:\Python33\pythonw -u "timitmod.py"
17.052203122286194
>Exit code: 0


jmf



More information about the Python-list mailing list