At 01:29 PM 3/3/04 +1300, Greg Ewing wrote: >Tim Peters <tim.one at comcast.net>: > > > 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? > >If you have a gazillion distinct functions in memory at >once, you've got a gazillion code objects, plus associated >function objects, arg name tuples, etc... Adding a stack >frame to each of these probably won't make a huge difference, >relatively speaking. Frames are over three times larger than a function and a code object put together: Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.8 -- press F1 for help >>> import types >>> types.FrameType.__basicsize__ 336 >>> types.FunctionType.__basicsize__ 40 >>> types.CodeType.__basicsize__ 64 Of course, this doesn't include the bytecode length, but bytecode is quite compact.
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