So,
Annoyed by the ~12 second incremental do-nothing build-time of writer,
and anticipating the growth of this as we gnu-make-ise the entire build
[ and I appreciate this is better than before but just up-front ;-]. I
did a bit of profiling.
$ time make
[ build ALL ] top level modules: sw
[ build ALL ] loaded modules: sw
[ build CHK ] loaded modules: sw
make: Nothing to be done for `allandcheck'.
real 0m12.604s
user 0m10.347s
sys 0m2.244s
* Thought one:
Having done an strace - it seems to me that over 2 seconds of that
system time (and I have a fast machine) is consumed simply with stat
syscalls; the attached stat.c does a (typical) stat call 770k times and
it takes me 2 seconds. 97% of our syscalls are 'stats' (770k of them),
and of course they are almost all for the same files.
stats file
822
/data/opt/libreoffice/bootstrap/solver/300/unxlngi6.pro/inc/offuh/com/sun/star/uno/XInterface.hdl
..
836 /data/opt/libreoffice/bootstrap/solver/300/unxlngi6.pro/inc/comphelper/fileformat.h
..
876 /data/opt/libreoffice/bootstrap/solver/300/unxlngi6.pro/inc/vcl/dllapi.h
988 /data/opt/libreoffice/bootstrap/clone/writer/sw/inc/swtypes.hxx
1307
/data/opt/libreoffice/bootstrap/solver/300/unxlngi6.pro/workdir/Dep/LinkTarget/Library/libswli.so.d
1315
/data/opt/libreoffice/bootstrap/solver/300/unxlngi6.pro/workdir/LinkTarget/Library/libswli.so
1428 /data/opt/libreoffice/bootstrap/clone/writer/sw/inc/swdllapi.h
http://users.freedesktop.org/~michael/stat-counts.txt - for the full list
So - the thought is: *why* is gnumake doing this work again and again ?
*surely* we know what output files a make rule touches [ and if we do
not we have problems anyway ], and thus we should know that no files
have changed since last time; can we not assume that and save a ton of
system-calls ?
* Thought two
Amdahl is not kind to people optimising the 20% instead of the 80%, but
perhaps other silliness is tied to this.
Have we done any investigation on what is going on in the guts of make
there ? why is it so paranoid as to stat the same files 1000 times or
so ?
It'd be nice to know if any further thinking / deeper digging has gone
on here, before looking myself.
Thoughts appreciated :-)
Michael.
--
michael.meeks@novell.com <><, Pseudo Engineer, itinerant idiot
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <pwd.h>
int doit(void)
{
}
int main (int argc, char **argv)
{
struct stat st;
int i;
for (i = 0; i < 749074; i++) {
stat
("/data/opt/libreoffice/bootstrap/solver/300/unxlngi6.pro/workdir/Dep/LinkTarget/Library/libswli.so.d",
&st);
}
return 0;
}
Context
- [Libreoffice] a faster gnumake ? ... · Michael Meeks
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.