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#62780: 30.0.50; Redisplay gets slow when using Org tables + show-trailing-whitespace Date: Fri, 14 Apr 2023 15:06:17 +0300 Message-ID: <83pm86fz2e.fsf@gnu.org> References: <87mt3e8d50.fsf@localhost> <83y1my8bmi.fsf@gnu.org> <87h6tm8awi.fsf@localhost> <83bkjt8t4l.fsf@gnu.org> <87bkjsf72g.fsf@localhost> <83ttxk3vt8.fsf@gnu.org> <873554f2ye.fsf@localhost> <83sfd34ztm.fsf@gnu.org> <87zg7an7lq.fsf@localhost> <83ttxig375.fsf@gnu.org> <87pm86n1au.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19394"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62780@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 14 14:07:21 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 1pnID2-0004qW-MX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Apr 2023 14:07:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnICn-00018L-JF; Fri, 14 Apr 2023 08:07:07 -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 1pnICk-00018D-L7 for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 08:07: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 1pnICk-0008MG-BN for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 08:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnICj-0006jw-UW for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 08:07: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: Fri, 14 Apr 2023 12:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62780 X-GNU-PR-Package: emacs Original-Received: via spool by 62780-submit@debbugs.gnu.org id=B62780.168147398825862 (code B ref 62780); Fri, 14 Apr 2023 12:07:01 +0000 Original-Received: (at 62780) by debbugs.gnu.org; 14 Apr 2023 12:06:28 +0000 Original-Received: from localhost ([127.0.0.1]:45710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnICC-0006j4-5I for submit@debbugs.gnu.org; Fri, 14 Apr 2023 08:06:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnICA-0006ip-MO for 62780@debbugs.gnu.org; Fri, 14 Apr 2023 08:06:27 -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 1pnIC5-0008GQ-8I; Fri, 14 Apr 2023 08:06:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aisgFXqnHaLwYecvJx/pGVRRAfUh2/SRvg3vp6JjePA=; b=AEZTfoHLK5Ya JUL0li23uevL0/qWBEYdN6+Z/ZBiVnni2ESxtvHS7VxUyMBNPNCRCx7jUCz5mB/vPPZyaF3EJwz18 FTU3SLj2qglidgx0UA8zQ8OO36gM93v1iTbJOtEupRzxVW0BwM7psbwEirY6WfWGLdX1l5Af0y3CH /2Y186NHIvSYCjUWZp7qQDKpHo8/QAyLF78dy4M2jT0NK+pXIKdNjfKOeedINizX0A5r/jqY5g4O7 NIgz1CC3UD0CLpouZenDnzpiRmwDWRR3Qm8v9NHtjR3KcLe6KGYwiGFwL3cYUbIDOdBWsebZOjnc4 gh5BO14Pvsn2QX54CYDaEg==; 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 1pnIC4-0006Zb-Gb; Fri, 14 Apr 2023 08:06:20 -0400 In-Reply-To: <87pm86n1au.fsf@localhost> (message from Ihor Radchenko on Fri, 14 Apr 2023 11:36:09 +0000) 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:259904 Archived-At: > From: Ihor Radchenko > Cc: 62780@debbugs.gnu.org > Date: Fri, 14 Apr 2023 11:36:09 +0000 > > Eli Zaretskii writes: > > >> I cannot reproduce. > >> The typing has no noticeable delays. > > > > Your build is optimized, yes? Try building without optimizations, you > > will see quite significant delays just by creating the table. > > Sure, but there is no obvious culprit then: The culprit is the humongous number of calls to handle_stop, I think. > Looking int the code, I can see that handle_display_prop does not call > Fnext_single_property_change at all and face_at_pos limits the forward > lookup by TEXT_PROP_DISTANCE_LIMIT. In contrast, compute_stop_pos calls > composition_compute_stop_pos without making use of > TEXT_PROP_DISTANCE_LIMIT (AFAIU) and looks all the way to point-max. (Do > I understand correctly that it implies O(N_intervals^2)??) > > > In any case, if you think disabling static composition can be a > > reasonable option for Org Table users (do they use > > prettify-symbols-mode, for example, in the same buffer where they have > > Org tables?), that should be easy. > > I'd still prefer to find a better way and leave this workaround as the > last resort. OK, I have an idea: I think the fact that compute_stop_pos calls find_composition (via composition_compute_stop_pos) is a mistake, because the 'composition' text property is found by the previous code in compute_stop_pos, exactly like we find 'display' and 'fontified'. So compute_stop_pos has no reason to call find_composition. But to test this idea, I need enough test cases that use the 'composition' property to make sure the property still works after I disable that call. Can you collect a few test cases which use the 'composition' property, with or without Org tables? I guess prettify-symbols-mode is one of them, but are there others? I will then try to find time to test this idea.