From: Junio C Hamano Date: Sun, 21 Jun 2026 23:17:43 GMT Subject: Re: git-diff in a worktree is an order of magnitude slower? Message-ID: In-Reply-To: <20260621212805.GB2297179@coredump.intra.peff.net> Jeff King writes: > 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. That's cute.