[Zope-dev] Will restrictedTraverse() load every obj into memory?

zhimin at iss.nus.edu.sg zhimin at iss.nus.edu.sg
Wed Sep 17 23:42:37 EDT 2003


Hello,

I have a function that returns the object when given a path.

def path2Object(path):
    obj = context,restrictedTraverse(path)
    return obj

My concern is whether restrictedTraverse(path) will load into memory every
object it traverses through and thus increase memory usage, especially if
it is run very frequently and with different path each time.
e.g. if my path is '/x/y/z/myobj',  will object x, y, and z also get loaded
when the object I really want is myobj? What's the state of x,y,z after
calling restrictedTraverse(path) - loaded or ghost?

If intermediate objects (like x, y, z above) get loaded, is there anyway to
ghostify them to reduce memory usage?
...or is there a memory-economic way to get object by path?

Many thanks!


cheers,
Zhi Min






More information about the Zope-Dev mailing list