gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees


From: Tom Lord
Subject: Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees
Date: Thu, 8 Jan 2004 16:20:09 -0800 (PST)

    > From: Aaron Bentley <address@hidden>

    > I think there's a bit of crosstalk-- as I read it, Miles wants to avoid
    > creating the tmp even when diff has output, because renames are
    > expensive on NFS.

Not just renames -- actually creating and removing the file, even if
it is not renamed, is more expense than needed.   If all FS operations
are expensive -- the tmp file should never exist at all unless we know
it is needed.


    > That would mean going straight to the final filename when producing
    > changesets.  But I haven't looked at the code, so I don't know whether
    > that's practical or not.

It's quite practical though various suggestions for how to do it
("read from the pipe and create the file if it isn't empty") miss the
mark.   Someone, I forget who, already gave the right answer.   

There's a function in `src/tla/libarch/make-change.c' called
`emit_file_or_symlink_patches' that creates the file for diff output
before figuring out if there will _be_ any diff output.  It deletes
the file if diff invocation exits with status 0.  At the same time,
the only way that diff is ever invoked, from `arch_invoke_diff',
doesn't bother to actually invoke diff unless it is certain that there
_will_ be output (this was a big performance improvement a while
back).  Simply deferring the creation of the file until it is certain
that diff will actually run will do the trick.  It's a simple
refactoring.

-t





reply via email to

[Prev in Thread] Current Thread [Next in Thread]