[IronPython] Performance of dir

Michael Foord fuzzyman at voidspace.org.uk
Sun May 24 01:43:38 CEST 2009


Hello all,

On IronPython 2.0.1 the last line of this code takes ~4 seconds the 
first time it is executed:

 >>> import clr
 >>> clr.AddReference('System.Windows.Forms')
 >>> from System.Windows.Forms import *
 >>> dir(Form)

Form.__dict__.keys() (which for a .NET type is equivalent) takes ~1 
second or less. What extra work is dir doing? (Is it pulling in the xml 
docstrings?)

Thanks

Michael

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list