From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#25706: 26.0.50; Slow C file fontification Date: Sat, 12 Dec 2020 15:34:33 +0000 Message-ID: References: <05F2A660-A403-4B81-AE77-416A739160A7@acm.org> <878sa7h1a2.fsf@gmail.com> <878sa5twmq.fsf@gmail.com> <87ft4czjri.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28341"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Lars Ingebrigtsen , 25706@debbugs.gnu.org To: Ravine Var Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 12 19:49:59 2020 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 1ko9xv-0007EQ-JD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Dec 2020 19:49:59 +0100 Original-Received: from localhost ([::1]:33448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ko9xu-00034p-Ip for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Dec 2020 13:49:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ko9kr-0005zO-7c for bug-gnu-emacs@gnu.org; Sat, 12 Dec 2020 13:36:29 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ko9kq-0008Iy-Sr; Sat, 12 Dec 2020 13:36:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ko6vG-00014v-E1; Sat, 12 Dec 2020 10:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 12 Dec 2020 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25706 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 25706-submit@debbugs.gnu.org id=B25706.16077872834048 (code B ref 25706); Sat, 12 Dec 2020 15:35:02 +0000 Original-Received: (at 25706) by debbugs.gnu.org; 12 Dec 2020 15:34:43 +0000 Original-Received: from localhost ([127.0.0.1]:46294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ko6ux-00013C-97 for submit@debbugs.gnu.org; Sat, 12 Dec 2020 10:34:43 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:23410 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ko6uv-00012g-O1 for 25706@debbugs.gnu.org; Sat, 12 Dec 2020 10:34:42 -0500 Original-Received: (qmail 35932 invoked by uid 3782); 12 Dec 2020 15:34:34 -0000 Original-Received: from acm.muc.de (p2e5d526c.dip0.t-ipconnect.de [46.93.82.108]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sat, 12 Dec 2020 16:34:33 +0100 Original-Received: (qmail 29779 invoked by uid 1000); 12 Dec 2020 15:34:33 -0000 Content-Disposition: inline In-Reply-To: <87ft4czjri.fsf@gmail.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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" Xref: news.gmane.io gmane.emacs.bugs:195844 Archived-At: Hello, Ravine. On Fri, Dec 11, 2020 at 16:25:20 +0530, Ravine Var wrote: > Alan Mackenzie writes: > > To fix this, can I ask you, please, to try adding the following patch to > > your already patched software, and let me know if it helps at all. If > > it does, that's great, if not, could I ask you to do another profile for > > me on the less powerful machine, say by opening the buffer, starting the > > profiler, then moving to the middle of the buffer with C-u 5 M->. This > > may take some time to profile. Thanks! > Doing C-u 5 M-> just jumps to the middle immediately. The problem > happens when the file is opened and I start scrolling with C-v. > With the new patch, things are still bad - emacs freezes almost > instantly. I've had a good look at your latest profile result. There doesn't seem to be any further untoward looping of low-level functions. So I'm not sure what more to fix, other than.... Have you got the option fast-but-imprecise-scrolling set (or customized) to non-nil? If not, could I suggest you try it. It's effect is to stop Emacs fontifying every screen it scrolls over, instead only fontifying screens when it's got no more input commands waiting. This speeds things up quite a bit on a slower machine. > I tested with 3 patches applied from messages 35, 95 and 128. > Here's the profile with emacs -Q : > https://gist.github.com/ravine-var/48b3e1469ac5a7f3c3df8d6d9313661a Thanks! There appear to be about 8 seconds worth of profile data there. How many screenfulls, approximately, did you actually scroll over in that time? Or, rather than answering that question, could I get you to try another timing test? Please put the following code into your *scratch* buffer (it's the same code I've posted before) and evaluate it: (defmacro time-it (&rest forms) "Time the running of a sequence of forms using `float-time'. Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"." `(let ((start (float-time))) ,@forms (- (float-time) start))) Then please load osprey_reg_map_macro.h freshly into a buffer, and type (or cut and paste) the following into M-: (time-it (let ((n 10)) (while (> n 0) (scroll-up) (sit-for 0) (setq n (1- n))))) What is the reported timing for scrolling these ten screens? Thanks! -- Alan Mackenzie (Nuremberg, Germany).