Title: remove 4 ints from PyFrameObject
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, nnorwitz, tim.peters
Priority: normal Keywords: patch

Created on 2005-10-25 06:18 by nnorwitz, last changed 2006-05-23 18:59 by tim.peters. This issue is now closed.

File name Uploaded Description Edit
remove-4-frame-ints.patch nnorwitz, 2005-10-25 06:18
Messages (4)
msg48903 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-10-25 06:18
Decreases the size of each frame object by 32 bytes. 
The 4 ints are already in the PyCodeObject.  Well, 2
are in there directly (co_nlocals and co_stacksize). 
The other 2 are the tuple lengths of co_cellvars and

I ran pybench before and after the patch.  With the
patch, the interpreter was .002 seconds slower, ie,
noise.  I get more variability than that with each

Mostly the change is from using f->f_... to co->co_...
 ie, no difference in pointer derefs, just deref a
different pointer.  

I don't see a good reason to duplicate the data.
msg48904 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-11-02 07:14
Logged In: YES 

Heh, my math sucks.  It should be 16 bytes, not 32.  Though
I got rid of 1 more (f_restricted), so it's really 20 bytes
now.  I need to clean up the patch and attach here.
msg48905 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-20 10:37
Logged In: YES 

Can this go into 2.5?
msg48906 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2006-05-23 18:59
Logged In: YES 

Yes, it can.  And did!  Thanks be to Richard Jones.
Date User Action Args
2005-10-25 06:18:09nnorwitzcreate