Re: git-diff in a worktree is an order of magnitude slower?
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> But at the point that we are comparing nanoseconds, I don't think we
> even need to bother with the delay. It takes maybe 5 seconds to write
> out all of the linux.git files and then the final index. So ~20% of
> those files will have the same timestamp as the index. With nanosecond
> resolution, we'd expect that to drop by an order of a billion. Even if
> we get unlucky and have a single file with the same timestamp, that is
> not so bad.
>
> The code to do the nanosecond compare is already there! But it's gated
> on USE_NSEC. So this (plus a bonus debugging trace ;) ):
> ...
> if (!changed && is_racy_timestamp(istate, ce)) {
> + warning("%s is racy", ce->name);
> if (assume_racy_is_modified)
> changed |= DATA_CHANGED;
> else
>...
> makes the problem go away. I'm not sure if I'm missing some case where
> we could be bitten by the problem that led to making USE_NSEC
> conditional, though.