A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/042888.html below:

[Python-Dev] [ python-Patches-876206 ] scary frame speed hacks

[Python-Dev] [ python-Patches-876206 ] scary frame speed hacks [Python-Dev] [ python-Patches-876206 ] scary frame speed hacksRaymond Hettinger python at rcn.com
Tue Mar 2 14:42:08 EST 2004
> [Skip]
> > Why not a list of pre-made frames for each code block (default
length
> 1)?
> 
> Or, IOW, per-code-block frame freelists (plural).  Recursive
generators
> have
> gotten quite popular in my code <wink>.
> 
> BTW, if a gazillion distinct functions run when starting up a large
app,
> do
> we hang on to the memory for their gazillion distinct frames forever?
> Recycling from a common frame pool has memory benefits in cases other
than
> just recursion.  Experiment:  run test.py from a Zope 2 or Zope 3
> checkout,
> and look at highwater memory consumption with and without the patch.

We should look at keeping the freelist and when a code block needs a
frame,
it can request the one that it last used if available.  Roughly:

def getblock(idnum):
   if idnum in freelist:
       return freelist[id]
   if len(freelist):
       return freelist.pop()
   return makeNewFrame()


Raymond


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4