[Gtk-sharp-list] Increesing glade-sharp speed
Miguel de Icaza
miguel@ximian.com
16 Oct 2003 22:17:55 -0400
Hello,
> Ok, the output of mono --profile mBloggy.exe prints this methods and the
> memory used by each one:
>
> 292 KB Glade.XML::.ctor(Assembly,string,string,string)
> 220 KB System.Collections.ArrayList::.ctor()
> 99 KB System.Array::CreateInstance(Type,int)
> 66 KB System.Xml.XmlConstructs::.cctor()
> 52 KB
> System.Collections.Hashtable::.ctor(int,single,IHashCodeProvider,ICo
> mparer)
> 49 KB
> System.MonoCustomAttrs::GetCustomAttributes(ICustomAttributeProvider
> ,Type,bool)
>
> So..
> Total memory allocated: 1163 KB
>
> I know it maybe sounds stupid to think in decreasing that use of memory
> (for example, to use less than 1000 KB). But, the Glade.XML it's using
> 292 KB, is it normal to use that memory just for loading the file?
With the current implementation, it is correct. This is used as a
temporary block of memory to load the glade file, and then pass that to
glade routines.
This is a good catch, because there is an API call that we could use in
this case. I say we could, because it is an internal call in corlib
that is not exposed to the world (in fact, its what is used by the
stream returned inside this constructor).
I do not know of a clean way of dealing with this though
Miguel.