I've just reported the following bug upstream: ------------------------------------------------------------------ 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. ------------------------------------------------------------------ Note that Emacs cannot even be interrupted with C-g (this may be an additional bug in Emacs).
I'm attaching it in this message for the Debian bug.
reassign 1079088 emacs severity 1079088 normal thanks El 20/8/24 a las 2:10, Vincent Lefevre escribió: As pointed out by Paul Eggert in bug-diffutils, diff -d is *inherently* slow. This is documented in the diff --help output:
Control: forwarded -1 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79546 Control: retitle -1 emacs: opening a diff file in diff-mode can be very slow Control: found -1 1:30.1+1-6 Control: found -1 1:30.1+1-9 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79546 with a simpler testcase: $ echo . > file1 $ seq 50000 > file2 $ diff -u file1 file2 > file.diff $ emacs -Q file.diff takes 17 seconds on my machine. With 100000 instead of 50000, this takes 72 seconds, i.e. about 4 times as much. But I think that the best solution would be a limit detection in diff, above which the faster (but not giving a minimal diff) algorithm should be used.
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran, Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun. Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie für weitere Details.
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran, Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun. Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie für weitere Details.