From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16526: 24.3.50; scroll-conservatively & c-mode regression Date: Sat, 01 Feb 2014 12:41:51 +0200 Message-ID: <834n4j5d3k.fsf@gnu.org> References: <83r47wausm.fsf@gnu.org> <52E3EAC2.2040100@gmx.at> <83lhy4as2l.fsf@gnu.org> <52E4019C.5080905@gmx.at> <83k3dnc3rl.fsf@gnu.org> <83iot7c3bq.fsf@gnu.org> <52E4EF61.3050404@gmx.at> <831tzubqxw.fsf@gnu.org> <20140126204310.GA3937@acm.acm> <52E61704.6050807@gmx.at> <20140129223626.GD3092@acm.acm> <52EA0124.4000809@gmx.at> <52EA57D6.5080403@gmx.at> <83txcl75nj.fsf@gnu.org> <52EAA0C9.1090000@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1391251394 811 80.91.229.3 (1 Feb 2014 10:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Feb 2014 10:43:14 +0000 (UTC) Cc: acm@muc.de, 16526@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 01 11:43:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W9Y2i-0003q2-Nk for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Feb 2014 11:43:20 +0100 Original-Received: from localhost ([::1]:36961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Y2i-0006Sw-Bu for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Feb 2014 05:43:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Y2a-0006LA-Ry for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 05:43:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Y2V-0004HK-QV for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 05:43:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Y2Q-0004GP-KW; Sat, 01 Feb 2014 05:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W9Y2Q-0006o7-7T; Sat, 01 Feb 2014 05:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 01 Feb 2014 10:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16526 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 16526-submit@debbugs.gnu.org id=B16526.139125133326101 (code B ref 16526); Sat, 01 Feb 2014 10:43:02 +0000 Original-Received: (at 16526) by debbugs.gnu.org; 1 Feb 2014 10:42:13 +0000 Original-Received: from localhost ([127.0.0.1]:43959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9Y1c-0006mu-Oz for submit@debbugs.gnu.org; Sat, 01 Feb 2014 05:42:13 -0500 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:57790) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9Y1Z-0006mk-Gi for 16526@debbugs.gnu.org; Sat, 01 Feb 2014 05:42:11 -0500 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N0B00B00BK37K00@mtaout26.012.net.il> for 16526@debbugs.gnu.org; Sat, 01 Feb 2014 12:41:09 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N0B00ARCCCKQG40@mtaout26.012.net.il>; Sat, 01 Feb 2014 12:41:09 +0200 (IST) In-reply-to: <52EAA0C9.1090000@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84393 Archived-At: > Date: Thu, 30 Jan 2014 19:58:17 +0100 > From: martin rudalics > CC: acm@muc.de, 16526@debbugs.gnu.org > > > It takes about 11 sec here. But reverting the patch doesn't change > > this timing, I still get 11 sec. > > But it does take longer with a maximized window? Yes, it does. > If so, do you have an explanation? Those 11 seconds are spent inside 'recenter', which is called by end-of-buffer: ;; If we went to a place in the middle of the buffer, ;; adjust it to the beginning of a line. (cond ((and arg (not (consp arg))) (forward-line 1)) ((and (eq (current-buffer) (window-buffer)) (> (point) (window-end nil t))) ;; If the end of the buffer is not already on the screen, ;; then scroll specially to put it near, but not at, the bottom. (overlay-recenter (point)) (recenter -3)))) <<<<<<<<<<<<<<<<<<<<<<<<<< Stepping through 'recenter', I see the following: . It treats GUI frames specially (and indeed, in "emacs -nw", I don't see this slowdown). The special handling is that it attempts to find the window-start point that corresponds to the -3 argument, by interpreting that argument as the number of pixels equivalent to 3 canonical-height lines. . To this end, 'recenter' calls move_it_vertically_backward with the -3 argument converted to pixels. move_it_vertically_backward then tries to find that place, by simulating display. . As part of the display simulation, jit-lock-function is called (because we hit a buffer position which has a non-nil 'fontified' property) with a single argument: buffer position 948757. This single call takes almost all of the 11 seconds. When the frame is not maximized, the window height is smaller, so 'recenter' moves back a smaller amount of pixels, and calls jit-lock-function at a different buffer position. That call takes only about 2 sec (still quite a lot, IMO). Perhaps Alan could explain why the CC Mode fontification takes such a long time for buffer position 948757.