[Mono-devel-list] Proposal: Library Loading

Michal Moskal malekith at pld-linux.org
Wed Apr 14 13:20:31 EDT 2004

On Wed, Apr 14, 2004 at 01:28:40PM +0200, Paolo Molaro wrote:
> > > The benefit is that Mono only needs to open *one* configuration file
> > > instead of having to get a directory listing, and load multiple files,
> > > which impacts startup time. 
> > 
> > Premature optmization is root of all evil :-)
> [...]
> > I run this program against directory with 1000 small files. It took
> > 0.03s on my athlon box and 0.15s on Pentium 266 (with heavy load). Now
> > consider that you will have 50 not 1000 files there, so it will take
> > 1ms on modern box.  Nowhere near other startup costs.
> That's no reason to add up to them, though:-) Especially when a
> perfectly fine way of doing things doesn't need to. Also, your numbers
> are with a warm cache 

Why should I use the cold cache? It will be hot after the first
application using mono starts, and will remain hot if there are more
such startups. The hot cache is simply the typical case when we care
about startup performance.

> and you don't consider the memory usage given by
> loading the info from 50 configuration files when you either don't need
> it at all or maybe just one.

I believe the memory requirements are no bigger then for single
configuration file. You just need to concatenate the files (using custom
file reading function for XML parser) and parse the result. Of course
spawning separate XML parser for each file would eat more memory.

Anyhow, there are two problems with separate program: a) it needs to be
written and maintained :-), b) you need to run it from %post script in
case of RPM (or whatever else for other packagers). These scripts are 
now empty, so packaging is a bit easier (no extra dependencies etc).

Having said all that, if there will be need to run gacutil from %post
anyway, then maybe it is possible to join mlibmap into gacutil, making
it simply GAC implementation detail. Maybe even there is no need for
separate .libmap files -- we can use custom attribute in assembly

BTW the generated file should not be kept in /etc, since users shall
not edit it.

: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: When in doubt, use brute force. -- Ken Thompson :: UL++++$ C++ E--- a?

More information about the Mono-devel-list mailing list