Samba as library

Peter Samuelson peter at cadcamlab.org
Sat Feb 12 15:56:46 GMT 2000


[Claudia Moroder]
> But having many smbd means using much memory.

No.  The text segment of the executable (i.e. the program code itself)
is shared between processes, just like shared library text.  The only
time shared libraries save memory is if *different* executable files
use them -- they are no advantage if you just have a *single* exe.

> I' don't know how big the overhead is when i call .so libraries in
> Linux and other unices ( I remember on the amiga there was a small
> overhead ).

Not sure how much overhead, but there is some.  At startup, you have to
load the library in (this is not done by the kernel, but by your
dynamic linker, such as /lib/ld-linux.so in Linux).  Then, the dynamic
linker has to resolve symbols, which on ELF-based systems takes a fair
amount of work.  Finally, runtime efficiency is also affected by the
fact that shared libraries are compiled in PIC, or position-independent
code, which on most architectures gives something of a performance
penalty.

I have heard it said that Perl compiled to use perl.so can be 15%
slower than compiled as one big executable.  I do not know if that is
true or not.  The figure does seem high.

Peter


More information about the samba-technical mailing list