Fredrik Lundh wrote: >> Could it just be that instantiating instances of new-style classes is >> slower than instantiating instances of old-style classes? There's not >> anything in what you've posted to suggest that exceptions are involved >> directly.
for completeness, here's the corresponding results from 2.4: python -mtimeit -s "class Exception(object): pass" "Exception()" 1000000 loops, best of 3: 0.278 usec per loop python -mtimeit -s "class Exception: pass" "Exception()" 1000000 loops, best of 3: 0.387 usec per loop python -mtimeit "Exception()" 1000000 loops, best of 3: 0.989 usec per loop > python -mtimeit -s "class Exception(object): pass" "Exception()" > 1000000 loops, best of 3: 0.284 usec per loop > > python -mtimeit -s "class Exception: pass" "Exception()" > 1000000 loops, best of 3: 0.388 usec per loop > > python -mtimeit "Exception()" > 1000000 loops, best of 3: 1.95 usec per loop </F> _______________________________________________ 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