Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


On 22.01.2015 15:31, Ashod Nakashian wrote:

I've done some profiling of LO build and one of the common events is the
spawning of bash and mv (on cygwin).
Another performance investigation (deps and pch) took me
to filter-showIncludes.awk where I found the source of the thousands of
mv spawns.

    close(tempfile)
    movecmd = "mv " tempfile " " depfile
    ret = system(movecmd)

It seems that filter-showIncludes.awk is writing the dependency file .d
in a .tmp file first, then it's renaming it to .d.
Considering that the input is piped from stdin and .d either doesn't
exist or will be overwritten (and is never an input,) the wisdom of
writing to a temp file and then moving is lost on me.

the point is to have an atomic update of the make target, i.e. if the
build is interrupted for whatever reason, prevent an incompletely
written .d file with up-to-date time stamp that will very likely break
the next build.

A complete build generates close to 9000 .d files in CxxObject alone.
Spawning processes and doing file I/O in the several thousands are bound
to have a toll.

sure but filter-showIncludes is only run when the C++ compiler is also
run on the file and that will take a lot longer than forking a "mv" process.



Context


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.