From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Achim Gratz Newsgroups: gmane.emacs.bugs Subject: bug#45320: 27.1; diff-refine performance regression Date: Sat, 19 Dec 2020 09:12:52 +0100 Message-ID: <87a6ua5i4b.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22413"; mail-complaints-to="usenet@ciao.gmane.io" To: 45320@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 19 09:14:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqXNU-0005jK-Aa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 09:14:12 +0100 Original-Received: from localhost ([::1]:42352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqXNT-0005K2-8r for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 03:14:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqXNK-0005Ji-LW for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 03:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqXNK-0005ON-Dv for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 03:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqXNK-0004Tv-7k for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 03:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Achim Gratz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Dec 2020 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45320 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160836559117154 (code B ref -1); Sat, 19 Dec 2020 08:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Dec 2020 08:13:11 +0000 Original-Received: from localhost ([127.0.0.1]:40777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqXMV-0004Sc-F1 for submit@debbugs.gnu.org; Sat, 19 Dec 2020 03:13:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqXMU-0004SU-0C for submit@debbugs.gnu.org; Sat, 19 Dec 2020 03:13:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqXMT-0005GX-Re for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 03:13:09 -0500 Original-Received: from smtpout2.vodafonemail.de ([145.253.239.133]:58878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqXMR-0004wa-3K for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 03:13:09 -0500 Original-Received: from smtp.vodafone.de (unknown [10.2.0.33]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id 1A6D51231B6 for ; Sat, 19 Dec 2020 09:12:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexgo.de; s=vfde-smtpout-mb-15sep; t=1608365579; bh=KRKpE1mP67MYaWRcVPJTqwAdDC6UlYwL1kFPIsV3QZg=; h=From:To:Subject:Date; b=M6rgfyMy/QaB8PC2UbxwBgbsSJlDBS1mVeA2GEkF19al9xtJ00URr5hF+s2f2MU8s pBKNP86pWqhuRv4fPQVLgq1xUXe3WUHI8Ka8b0J72XKONwyFjFyHLLRiRkFGDYRcSI Ok5kcE1kWfMu3HcQHDAJaAx8Ye32E0RIpc5zbhJg= Original-Received: from Gertrud (p54a0ca05.dip0.t-ipconnect.de [84.160.202.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id A2EA114258A for ; Sat, 19 Dec 2020 08:12:58 +0000 (UTC) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 2068 X-purgate-ID: 155817::1608365578-000007FA-2097C69F/0/0 Received-SPF: pass client-ip=145.253.239.133; envelope-from=Stromeko@nexgo.de; helo=smtpout2.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196368 Archived-At: In GNU Emacs 27.1 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0) The following change is highly problematic: --8<---------------cut here---------------start------------->8--- ** Diff mode *** Hunks are now automatically refined by font-lock. To disable refinement, set the new user option 'diff-refine' to nil. To get back the old behavior where hunks are refined as you navigate through a diff, set 'diff-refine' to the symbol 'navigate'. --8<---------------cut here---------------end--------------->8--- The refinement is run synchronously and can't be interrupted. The used algorithm clearly has superlinear complexity with the size of the diff hunk. I frequently use diff-mode for comparison of log files from compilations, which routinely creates large hunks and sometimes very large ones. In mild cases that stalls Emacs for a few seconds upwards to a minute, but I'm encountering larger diff hunks regularly that do not complete refinement after more than an hour of burning through 100% CPU (and not a slow one) when I try. Due to the way this is implemented, the refinement can not be stopped from within Emacs and stopping it from the outside has a high propensity of killing Emacs and taking all unsaved work with it. Auto-refinement of diff hunks should 1. be stopped a) after a customizable time threshold (personally I'd be OK with something like 1s, but other folks may have less patience), b) when the user tries to move point (even small delays are annoying when you really just want to scroll through the file), c) when C-g or the corresponding signal is issued. 2. not be attempted at all a) when the hunk size exceeds a customizable threshold, b) when the diff in question has run into one of the performance thresholds multiple times already. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf Blofeld V1.15B11: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada