From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#59787: 29.0.60; Very slow pos-visible-in-window-p with long truncated lines Date: Wed, 07 Dec 2022 09:58:40 +0200 Organization: LINKOV.NET Message-ID: <86bkofvd0v.fsf@mail.linkov.net> References: <83v8mteffc.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="40788"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 59787@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 07 09:24:33 2022 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 1p2pjF-000AOm-6V for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 07 Dec 2022 09:24:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2pim-0003ep-Nu; Wed, 07 Dec 2022 03:24:04 -0500 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 1p2pik-0003e4-Nd for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 03:24:02 -0500 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 1p2pik-0005Ih-E2 for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 03:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2pij-0000mS-Lq for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 03:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Dec 2022 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59787 X-GNU-PR-Package: emacs Original-Received: via spool by 59787-submit@debbugs.gnu.org id=B59787.16704014352994 (code B ref 59787); Wed, 07 Dec 2022 08:24:01 +0000 Original-Received: (at 59787) by debbugs.gnu.org; 7 Dec 2022 08:23:55 +0000 Original-Received: from localhost ([127.0.0.1]:48459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2pic-0000mE-M1 for submit@debbugs.gnu.org; Wed, 07 Dec 2022 03:23:54 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:55579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2piX-0000m7-Kx for 59787@debbugs.gnu.org; Wed, 07 Dec 2022 03:23:52 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 5BE61E001C; Wed, 7 Dec 2022 08:23:40 +0000 (UTC) In-Reply-To: <83v8mteffc.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Dec 2022 22:09:11 +0200") 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:250166 Archived-At: > As reported in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56682#1977: > > 2. after starting Isearch at a large column number, > Emacs hangs up indefinitely, e.g. with > 'M-g TAB 10000000 RET C-s' then even C-g doesn't get out. > Debugging shows that the problem is in 'isearch-update' > where the call to 'pos-visible-in-window-group-p' doesn't return. > When this call is removed, the search is instantaneous. > (Optimizing lazy-highlight is a separate problem in bug#56815.) > > The problem is that pos-visible-in-window-p starts from window-start point > and goes to the POSITION passed as argument using move_it_to, which in this > case is very slow, because it has all the 10000000 columns to traverse. > > The solution is to introduce shortcuts into pos_visible_p in this case. Could you explain why pos-visible-in-window-p is instantaneous at any position when long lines are not truncated. Why it doesn't need to traverse 10000000 columns in this case?