[pypy-svn] r54004 - pypy/dist/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Tue Apr 22 12:57:07 CEST 2008


Author: arigo
Date: Tue Apr 22 12:57:06 2008
New Revision: 54004

Modified:
   pypy/dist/pypy/interpreter/pyframe.py
Log:
Reverting unless there is evidence that it's an improvement.
To me it looks like the result is worse:

* allocating an empty list is faster than pre-allocating items, so
  for frames that don't contain loops we loose

* if there are loops, it's very uncommon to have more than 4 nested
  levels (which is the default allocation size).



Modified: pypy/dist/pypy/interpreter/pyframe.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyframe.py	(original)
+++ pypy/dist/pypy/interpreter/pyframe.py	Tue Apr 22 12:57:06 2008
@@ -10,7 +10,7 @@
 from pypy.rlib.objectmodel import we_are_translated, instantiate
 from pypy.rlib.jit import we_are_jitted, hint
 from pypy.rlib import rstack # for resume points
-from pypy.rlib.objectmodel import newlist
+
 
 # Define some opcodes used
 g = globals()
@@ -54,7 +54,7 @@
         eval.Frame.__init__(self, space, w_globals, code.co_nlocals)
         self.valuestack_w = [None] * code.co_stacksize
         self.valuestackdepth = 0
-        self.blockstack = newlist(sizehint=20)
+        self.blockstack = []
         if space.config.objspace.honor__builtins__:
             self.builtin = space.builtin.pick_builtin(w_globals)
         # regular functions always have CO_OPTIMIZED and CO_NEWLOCALS.



More information about the Pypy-commit mailing list