Subject: diff -d can be very slow

From: Vincent Lefevre <[email-masked]>
Date: Tue, 20 Aug 2024 01:55:22 +0200

When opening a .diff file, GNU Emacs runs "diff -ad" on 2 files
it has built (I suppose that the reason is to get a word diff),
and this can be very slow, even though the original .diff file
is rather simple.

I've attached a slow-diff.tar.xz archive with:
  * diff1L52tn0 and diff2U4TVho (files built be GNU Emacs).
  * file.diff the original .diff file.

When running "/usr/bin/emacs -Q file.diff.xz", I could see what
takes the whole time with ps or top. Here I could see

  diff -ad /tmp/diff1L52tn0 /tmp/diff2U4TVho

As this is slow, I could obtain these files.

On my recent machine, "diff -ad diff1L52tn0 diff2U4TVho" takes
27 seconds.

-- 
Vincent Lefèvre <[email-masked]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)