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:23:55 +0300 Message-ID: <83mt3afy90.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> <83pm86fz2e.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31510"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62780@debbugs.gnu.org To: yantar92@posteo.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 14 14:25:26 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 1pnIUX-0007yL-OV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Apr 2023 14:25:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnIUC-0000te-DD; Fri, 14 Apr 2023 08:25:11 -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 1pnIUA-0000t8-T2 for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 08:25: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 1pnIUA-00079f-At for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 08:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnIUA-0007Gw-6n for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 08:25:02 -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:25: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.168147505027868 (code B ref 62780); Fri, 14 Apr 2023 12:25:02 +0000 Original-Received: (at 62780) by debbugs.gnu.org; 14 Apr 2023 12:24:10 +0000 Original-Received: from localhost ([127.0.0.1]:45757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnITK-0007FQ-0X for submit@debbugs.gnu.org; Fri, 14 Apr 2023 08:24:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnITE-0007EX-2D for 62780@debbugs.gnu.org; Fri, 14 Apr 2023 08:24:08 -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 1pnIT8-0006rX-G3; Fri, 14 Apr 2023 08:23:58 -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=KJKgo708bek7uO4NegQvsX3Zrc54RWFAOhx3K5/2RfA=; b=FjfJQLZ5IQCV 9GKNULwPkG/qi/VAXe1rOXPzwWLPlpPeOUv5yBhMzFLoQJWOQbH4TTiqD9C+SDVFU5YkU/IkpSOmN NzLjt3OUef3JOwhvog8ih1Lkaan1RdLpaijCu5XtbF8BQltuIWCZU2sLe66cm508w/mX62xsDdFvl dVZITMgjO1FqezKAZWy+jWZBn5FfZ7a9jciAyGlKr57J4NBcfL5LBfYLA8zWUOxAXZw48Ye0MsHvg LZ0ek3LZO1CkdktAQL2WTYzlkWy6iN3BQbZuYZsXUfKagPfr+OuUm6SqqafOfXp7EI0ii2DcG0Gsv 1FrjJDomdIkuErNIYLp7Hg==; 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 1pnIT6-0004WF-RM; Fri, 14 Apr 2023 08:23:58 -0400 In-Reply-To: <83pm86fz2e.fsf@gnu.org> (message from Eli Zaretskii on Fri, 14 Apr 2023 15:06:17 +0300) 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:259905 Archived-At: > Cc: 62780@debbugs.gnu.org > Date: Fri, 14 Apr 2023 15:06:17 +0300 > From: Eli Zaretskii > > > From: Ihor Radchenko > > Cc: 62780@debbugs.gnu.org > > Date: Fri, 14 Apr 2023 11:36:09 +0000 > > > > 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)??) Btw, it is not true that we are looking all the way to point-max in this case: you will see in composition_compute_stop_pos that it limits the search to the next 500 buffer positions: void composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t endpos, Lisp_Object string) { ptrdiff_t start, end; int c; Lisp_Object prop, val; /* This is from forward_to_next_line_start in xdisp.c. */ const int MAX_NEWLINE_DISTANCE = 500; if (charpos < endpos) { if (endpos > charpos + MAX_NEWLINE_DISTANCE) endpos = charpos + MAX_NEWLINE_DISTANCE; } [...] if (charpos < endpos && find_composition (charpos, endpos, &start, &end, &prop, string) && start >= charpos && composition_valid_p (start, end, prop))