> > Probably I found one reason comparation for classic style class is
slower on
> > Python2.5.
> > Comparation function instance_compare() calls
PyErr_GivenExceptionMatches(),
> > and it was just flag operation on 2.4. But on 2.5, probably related to
> > introduction of BaseException,
> > it checks inherited type tuple. (ie: PyExceptionInstance_Check)
>
> I'm curious about the speed of 2.6 (trunk).  I think this should have
> become faster due to the introduction of fast subtype checks (he says
> without looking at the code).
>
> n
>

Yes, I confirmed trunk is faster than 2.5.

///////////////////////////////////////
// Code

import timeit

t = timeit.Timer("""
f1 < f2
""", """
class Foo:
 pass
f1 = Foo()
f2 = Foo()
""")

print t.timeit(10000)

///////////////////////////////////////
// Result

release-maint24 0.337sec
release-maint25 0.625sec
trunk 0.494sec

//////////////////////////////////////
// Result of plex_test2.py

release-maint24 2.944sec
release-maint25 4.026sec
trunk 3.625sec

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to