[Python-Dev] pystone(object)

Jeremy Hylton jeremy@alum.mit.edu
Fri, 16 Aug 2002 15:09:17 -0400


Anyone interested in making pystone use a new-style class?  I just
tried it and it slowed pystone down by 12%.  Using __slots__ bought
back 5%.

On the one hand, we end up comparing the new-style class
implementation of one Python with the classic class version of older
Pythons.  On the other hand, we seems to think that new-style classes
are preferred.  I think we ought to measure them.

Jeremy


Index: pystone.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/pystone.py,v
retrieving revision 1.7
diff -c -c -r1.7 pystone.py
*** pystone.py	6 Aug 2002 17:21:20 -0000	1.7
--- pystone.py	16 Aug 2002 18:49:56 -0000
***************
*** 40,46 ****
  
  [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
  
! class Record:
  
      def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,
                         IntComp = 0, StringComp = 0):
--- 40,46 ----
  
  [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
  
! class Record(object):
  
      def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,
                         IntComp = 0, StringComp = 0):