From: Sean Russell Date: 2002-05-07T06:14:37+09:00 Subject: Re: Ruby vs. Java vs. Native trivia Chris Ross wrote: > The reason that this occurs is due to the following: > > o dynamic: when the application is loaded into memory there is a delay > on startup as the OS's dynamic linker loads all libraries that are > required by it. > > o static: only the executable is loaded into memory - the dynamic > linker doesn't have to do anything. muchos faster. > > Dynamic is more flexible as upgrading the library doesn't require a > recompile of apps that use it. I've never understood this. AmigaOS was heavily dependant on DLLs -- in fact, I don't think it was possible to build an app without linking to DLLs. Not only did the apps come up very quickly, but they consumed almost no memory, since huge parts of the codebase were, well, shared. I remember that, out of 4MB, just booting AmigaOS would consume about 2.5MB... but then you could run an amazing number of applications -- graphics editors, word processors, etc. -- within that 1.5MB of space. In any case, I'm /mostly/ baffled by the amount of memory and the time that is required by more modern OSes. I'm sure memory protection has something to do with it -- I'd guess that DLLs aren't shared across user space apps -- but I don't get into the internals of Linux much. Still, it would seem to me that the basic theory is fairly straightforward: you load system libraries in a shared, non-writeable space, and everybody just accesses them from there. The first person who runs KDE gets a big load time, but beyond that, it's just allocating per-user data spaces. You unload the library when it isn't used and gets swapped out of memory. This sounds rather off topic, and not the domain of Ruby anyway, but this has been bugging me for a while. --- SER