how many objects are loaded for hello world?
Collapse
This topic is closed.
X
X
-
belredTags: None -
Chris Rebert
Re: how many objects are loaded for hello world?
On Tue, Sep 16, 2008 at 11:13 PM, belred <belred@gmail.c omwrote:Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright" , "credits" or "license" for more information.134>>len(dir(__bui ltins__))
Regards,
Chris
--
Follow the path of the Iguana...
-
Fredrik Lundh
Re: how many objects are loaded for hello world?
belred wrote:
types and objects are different things, though. to get an idea of how
much stuff Python loads using upstart, do "python -vv script.py" or add
import sys
print len(sys.modules ), "modules"
print sys.modules.key s()
to the end of the script.
to get an idea of how many objects and types that are created at that
point, add
import gc
print len(gc.get_obje cts()), "objects"
print len(set(map(typ e, gc.get_objects( )))), "types"
this gives me 35 modules (including the gc module), 3219 objects and 26
distinct types -- but the above will miss things, so the true numbers
are a bit higher.
(you might be able to use a debug build to get more detailed information)
</F>
Comment
Comment