Subject: bug#12747: 23.4; diff-auto-refine-mode process only last hunk in diff (must ALL).

From: Stefan Monnier <[email-masked]>
Date: Thu, 12 Jul 2018 16:17:18 -0400

>>> This reminds that magit users found binding write-region-inhibit-fsync
>>> around smerge-refine-regions made a noticable performance difference.
>>> So should we add something like this?
>> Sounds good, yes (tho I'm surprised it'd make much of a difference,
>> when your /tmp is on some kind of tmpfs).  If you can add a URL
>> pointing to the discussion where they found the noticable performance
>> difference, that'd be even better.
> Hmm, actually there wasn't that much discussion about it, one person
> reported it made a big difference:
> https://github.com/magit/magit/pull/2834

Seems like a good enough URL top put there.

IIUC magit's code uses a different approach from the one I installed in
diff-mode (i.e. it eagerly calls smerge-refine on all hunks), which
is likely to suffer much more severely from performance issues on large
diffs, so I think write-region-inhibit-fsync won't make a big difference
for diff-mode, but it's still a good change in any case.

Note that both approaches suffer identically when bumping into a large
hunk, OTOH.

> There was previous discussion about smerge refinement being slow, but
> nobody narrowed it down to fsync in particular, and the conclusion
> there was just "call smerge-refine-subst less".

Yes, I think this one is really case of Magit's approach being simply
too eager.

        Stefan