[Libreoffice] a faster gnumake ? ...

Michael Meeks michael.meeks at novell.com
Mon Apr 4 07:07:32 PDT 2011


	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.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: stat.c
Type: text/x-csrc
Size: 374 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110404/440d0474/attachment.c>

More information about the LibreOffice mailing list