[Mono-devel-list] Proposal: Library Loading

Paolo Molaro lupus at ximian.com
Wed Apr 14 07:28:40 EDT 2004


On 04/14/04 Michal Moskal wrote:
> On Wed, Apr 14, 2004 at 01:31:49AM -0400, Miguel de Icaza wrote:
> > For example, Gtk# would install something like this:
> > 
> > <configuration>
> > 	<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0.200.3" />
> > </configuration>
> 
> But what happens when you install new version of libglib-2.0 (100%
> binary compatible)? You need to run mlibconf again. So postinstall
> scripts in any packaging system would need to run mlibconf. I believe
> most distros will have problems with this.

The config file mapping should not use the full shared library version.
For example, in the above case, it should use libglib-2.0.so.0.
This is the same name that is recorded in ELF binaries and the upstream
developers will change it only when binary compat is broken. This way
there is no issue with upgrading the library.

> > 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 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.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list