zsh-workers
 help / color / mirror / code / Atom feed
* libzsh overhead, minus the benefits
@ 2004-06-25 12:34 ari
  2004-06-26 11:57 ` Geoff Wing
  2004-06-26 18:09 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: ari @ 2004-06-25 12:34 UTC (permalink / raw)
  To: zsh-workers

The only potential reason that i see for having all zsh functionality in
libzsh.so, while keeping the zsh binary more or less a stub into the
library, is the reuse of shared memory mappings.  However, and correct
me if i'm wrong, the zsh shell is the only program that is meant to use
this library.  The idea seems to be that multiple instances of the
binary will run with a minimal amount of redundant code, saving memory
when many zsh processes are running simultaneously.

There is an error in this reasoning.  Modern systems offer shared
executable code mappings, so that if multiple instances of a binary are
running simultaneously, the majority of the code in memory will be
shared between processes.  Due to dynamic loader and function relocation
(indirection) overhead, using libzsh.so actually causes each running zsh
process to consume _more_ memory than if the code were compiled into the
original binary.  The indirection will also cause a slight increase in
processing time, as loading the library will cause a slight increase in
execution time.  In these cases, using a dynamic library only helps when
multiple, different executables require use of the same family of
functions.

Perhaps the use of libzsh.so should be reconsidered?

ari


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-27 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-25 12:34 libzsh overhead, minus the benefits ari
2004-06-26 11:57 ` Geoff Wing
2004-06-26 18:09 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).