[Libreoffice] DLL rebasing on Windows: WTF?
tlillqvist at novell.com
Thu May 12 02:15:59 PDT 2011
I asked about this on the OOo dev list, and here is an informative reply from Michael Stahl:
> Carsten did something in OOo 3.3 to improve startup performance.
> my vague memory of what he found out:
> on NT6 (Vista or newer) the OS does aggressive caching and cold start is
> very fast.
> on NT5 (XP, WS2003) the OS does not do much caching, the DLLs are
> demand-paged, and the result is that if you have a hard disk it will seek
> a lot and cold start will be slow.
> now there is a trick to force NT5 to not demand-page the DLLs: if their
> base addresses overlap, the runtime linker is forced to relocate them, and
> in order to do that, it reads in the entire DLL at once, without seeks.
> the CPU overhead of relocating is negligible compared with the seeking.
> so on NT5 you are better off with overlapping base addresses, and the
> thingy that runs after installation is supposed to do this.
> _but_ this makes sense only on a single user system (desktop).
> on a multi-user server the relocated DLLs cannot be shared in memory, and
> on a multi-user server OOo will probably be loaded in memory anyway by
> another user.
So I guess we should keep stuff as is then in postprocess and in the custom action.
Perhaps add a check to the installer custom action to do the rebasing back to overlapping addresses only on XP or older. That should speed up installation on Vista and newer a bit.
On Vista and newer the base addresses in the DLL will normally be ignored anyway, due to address space layout randomization. (But on Vista and newer, thanks to some new implementation tricks, the thus required relocation won't cause much slowdown, they say.)
The rebaseoo.exe and rebasegui.exe files we can stop shipping in my opinion, and remove their sources from git.
More information about the LibreOffice