From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko 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 11:36:09 +0000 Message-ID: <87pm86n1au.fsf@localhost> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11556"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62780@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 14 13:34:44 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 1pnHhU-0002l2-Bz for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Apr 2023 13:34:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnHgv-00071d-Mb; Fri, 14 Apr 2023 07:34:09 -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 1pnHgp-00071U-Gs for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 07:34:03 -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 1pnHgp-000086-7B for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 07:34:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnHgo-0005am-AU for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 07:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Apr 2023 11:34:02 +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.168147202521474 (code B ref 62780); Fri, 14 Apr 2023 11:34:02 +0000 Original-Received: (at 62780) by debbugs.gnu.org; 14 Apr 2023 11:33:45 +0000 Original-Received: from localhost ([127.0.0.1]:45675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnHgW-0005aH-H8 for submit@debbugs.gnu.org; Fri, 14 Apr 2023 07:33:44 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:34353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnHgT-0005a2-N3 for 62780@debbugs.gnu.org; Fri, 14 Apr 2023 07:33:42 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D89F02402F6 for <62780@debbugs.gnu.org>; Fri, 14 Apr 2023 13:33:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681472014; bh=6KI1cKf2eYad1621gCZeCVXL4tysWK25vTY0N5lrT9U=; h=From:To:Cc:Subject:Date:From; b=MC/LCCJO8bTvA1nldNQtxdtobxup20wFEEQLmBVpcLhMrojCAArS48SXy4BVlSFnC WZmwtsfgty7K8EWbL7LwvxAfMOph6Z7c2Et6uyxbYaUfsND6+y+Eircp9L5DUm3EtT rm/HDgUzZaOq78eWfm3SxtMSqG8T5u9j64KC0Hi+4HXWR+p1rM575KoE8sXzBehsWe V4a5Od+8qf46G5gTtY2if2yT8GWqev5oDnJaDM/SYaaULQkKB1fpgPIX3lAPHzJKnD riqDNohdgWIpBW9LB1mBYM+SVnCg2ixVhawIiK2JkRRJp0ZmGhccBITEvWYUgJ/tTY VboZQMCwgzOlw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PyZ8G3HXBz9rxf; Fri, 14 Apr 2023 13:33:34 +0200 (CEST) In-Reply-To: <83ttxig375.fsf@gnu.org> 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:259902 Archived-At: 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: 4.01% emacs emacs [.] lookup_char_property 3.04% emacs emacs [.] make_lisp_symbol 3.01% emacs emacs [.] find_interval 2.85% emacs emacs [.] next_interval 2.37% emacs emacs [.] XSYMBOL 2.27% emacs emacs [.] SYMBOLP 2.16% emacs emacs [.] make_lisp_symbol 2.06% emacs emacs [.] make_lisp_symbol Various functions contribute almost equally with relatively larger (yet, just 4%) contribution from lookup_char_property called from face_at_pos (according to the call graph). I looked into the number of calls to face_at_pos, find_composition, and handle_display_prop. The number of calls is almost the same. Thus, my guess is that find_composition is somehow slower than the other two functions. 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. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at