From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62352: Very slow scroll-down-line with a lot of text properties Date: Sat, 25 Mar 2023 17:02:12 +0300 Message-ID: <834jq9c4kb.fsf@gnu.org> References: <51545b85-029c-a6ff-f733-e486f261f6c0@gmail.com> <83355x7sx2.fsf@gnu.org> <08b5f766dd5d453016a7@heytings.org> <83sfdtcab8.fsf@gnu.org> <83h6u9c89f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8064"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62352@debbugs.gnu.org, gregory@heytings.org To: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 15:03:10 2023 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 1pg4U9-0001lP-Ee for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 15:03:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg4U3-00046o-Mu; Sat, 25 Mar 2023 10:03:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg4U2-00046f-Ji for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg4U2-0004nM-Bd for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg4U1-0007pv-Vg for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2023 14:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62352 X-GNU-PR-Package: emacs Original-Received: via spool by 62352-submit@debbugs.gnu.org id=B62352.167975294230038 (code B ref 62352); Sat, 25 Mar 2023 14:03:01 +0000 Original-Received: (at 62352) by debbugs.gnu.org; 25 Mar 2023 14:02:22 +0000 Original-Received: from localhost ([127.0.0.1]:43121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg4TO-0007oP-81 for submit@debbugs.gnu.org; Sat, 25 Mar 2023 10:02:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg4TL-0007oB-V3 for 62352@debbugs.gnu.org; Sat, 25 Mar 2023 10:02:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg4TG-0004f8-FP; Sat, 25 Mar 2023 10:02:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=4lL9zPLhd3M7DkiFcIV57vuj7Md2PSTcGNtwMeLtLys=; b=Hq70DcBZ8RHLeKLTG2ZL wlgba3FMJia8LIKYidayIH9ZHdG/gDMNJmxyNJIBv+kKAzyV4wSkzAWP72zhAy/Abc1/J9alBC3jv 319WkHHVCQiIBC7ZGNVXNxydXgrZUSx834cZc40FYhUtu5FpnHGwRJtTx2tHt/aAztOz2nOaawJW5 jgdmQBiz++Lj7u9+Y77C+VwbM1tlfyhCTp2FpAVyRLTIwrNYqqeV2SAlCsMvnKGkZ34Iw80GPwmI6 D/CLwykFlbQgvEJndyR9KBBH1B9/R6ujWGx22O989eUs50v5NF8f5QVpCPLDCLc90xyaQNqIhsKZI UudLi6Z1bQHqxQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg4TF-00086x-Tx; Sat, 25 Mar 2023 10:02:14 -0400 In-Reply-To: (message from Herman, =?UTF-8?Q?G=C3=A9za?= on Sat, 25 Mar 2023 14:41:04 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258573 Archived-At: > Date: Sat, 25 Mar 2023 14:41:04 +0100 > Cc: gregory@heytings.org, 62352-done@debbugs.gnu.org > From: Herman, Géza > > >> If I comment out these lines in composition_compute_stop_pos(), emacs > >> works better ("normal" scrolling becomes completely fluid, > >> scroll-down-line still freezes, but for a much shorter time): > >> > >>   /* if (charpos < endpos */ > >>   /*     && find_composition (charpos, endpos, &start, &end, &prop, > >> string) */ > >>   /*     && start >= charpos */ > >>   /*     && composition_valid_p (start, end, prop)) */ > >>   /*   { */ > >>   /*     cmp_it->stop_pos = endpos = start; */ > >>   /*     cmp_it->ch = -1; */ > >>   /*   } */ > >> > >> It seems that emacs does a huge amount of redundant work by scanning > >> approximately the same area over and over again for composition properties. > > This is a non-starter, unfortunately: the display engine _must_ > > support character composition, or else some scripts will display > > incorrectly, and some features (like prettify-symbols-mode) will stop > > working. > I'm not saying that this is the solution. I just wanted to point out > that emacs does unnecessary work. How can Emacs know that this is "unnecessary work"? You cannot know if the buffer contains any composable characters unless you search for them and fail to find them. > Note, even with this code commented > out, composition still seems to work. Maybe it's buggy, of course. If you comment out the call to find_composition, prettify-symbols-mode will stop working, and likewise any other features that use the 'composition' text property. > But the point is, it seems possible to fix this performance issue. yes, it is possible to make the Emacs display faster by removing some of the features it provides. But that is hardly the right way of "fixing" performance problems. > But saying that this issue is not a (performance) bug is not > correct, in my opinion. That's not what I said, though. > > Get a faster computer, or make your keyboard auto-repeat rate lower? > Maybe there is a 2x single-thread performance factor between my computer > and a current fast consumer desktop PC. It is highly unlikely that > getting a faster computer will solve this problem. My computer is a 10-year old machine.