From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3 Date: Sun, 5 Apr 2020 19:57:53 +0000 Message-ID: <20200405195753.GG5049@ACM> References: <20200403174757.GA8266@ACM> <20200404104553.GA5329@ACM> <07fe3b69-3ab2-3173-0696-cb17809e2b91@gmx.at> <83blo7v68b.fsf@gnu.org> <1845d7aa-9ae4-3d95-6a30-c7b1d8d8adec@gmx.at> <83a73qt6zs.fsf@gnu.org> <97c4254e-ff43-8402-3645-f713c408c245@gmx.at> <83y2r9syby.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="75192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: martin rudalics , Eli Zaretskii , rrandresf@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 05 21:58:38 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jLBPg-000JQs-AQ for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Apr 2020 21:58:36 +0200 Original-Received: from localhost ([::1]:51284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLBPf-00081C-Dh for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Apr 2020 15:58:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44967) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLBP6-0007cH-OG for emacs-devel@gnu.org; Sun, 05 Apr 2020 15:58:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLBP5-0002PP-MQ for emacs-devel@gnu.org; Sun, 05 Apr 2020 15:58:00 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:63163 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jLBP4-0002OU-El for emacs-devel@gnu.org; Sun, 05 Apr 2020 15:57:59 -0400 Original-Received: (qmail 74021 invoked by uid 3782); 5 Apr 2020 19:57:57 -0000 Original-Received: from acm.muc.de (p2E5D5461.dip0.t-ipconnect.de [46.93.84.97]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sun, 05 Apr 2020 21:57:53 +0200 Original-Received: (qmail 29912 invoked by uid 1000); 5 Apr 2020 19:57:53 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246490 Archived-At: Hello, Dmitry. On Sun, Apr 05, 2020 at 21:05:00 +0300, Dmitry Gutov wrote: > On 05.04.2020 19:15, Eli Zaretskii wrote: > >> Do you at least see CPU activity significantly go up when you do such > >> mouse wheel scrolling? > > With what build? With the -O0 build with --enable-checking, I don't > > need the mouse: it's enough to lean on C-v and let the keyboard > > auto-repeat do its job -- one execution unit of the CPU maxes out > > after 5 to 10 C-v's. > > But with a -O2 optimized production build, Emacs keeps up both when I > > lean on C-v and when I turn the mouse wheel constantly. > Same here. And much as I like to see certain modes improved, I'm not > sure this is only a performance problem. Because no matter how fast > syntax highlighting is, you can lean on C-v faster. > IIRC, redisplay-dont-pause was supposed to help with things like this. > But it doesn't (and it's obsolete), and apparently jit-lock does its > thing anyway. This looks like the interesting part of the profile: > - scroll-up 5657 73% > - jit-lock-function 5444 70% > - jit-lock-fontify-now 5439 70% > + jit-lock--run-functions 5431 70% > + run-with-timer 5 0% > Do you guys want to try (setq jit-lock-defer-time 0)? It comes with a > certain visual downside, though. > Or, alternatively, (setq fast-but-imprecise-scrolling t). This var seems > like a good idea in general, so we might consider going further with it. Try this: diff --git a/src/window.c b/src/window.c index 8cdad27b66..b23ae41aba 100644 --- a/src/window.c +++ b/src/window.c @@ -5475,7 +5475,9 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) wset_redisplay (XWINDOW (window)); - if (whole && Vfast_but_imprecise_scrolling) + if (Vfast_but_imprecise_scrolling + && (whole + || EQ (Vthis_command, Qmwheel_scroll))) specbind (Qfontification_functions, Qnil); /* On GUI frames, use the pixel-based version which is much slower @@ -8173,6 +8175,7 @@ syms_of_window (void) DEFSYM (Qmode_line_format, "mode-line-format"); DEFSYM (Qheader_line_format, "header-line-format"); DEFSYM (Qtab_line_format, "tab-line-format"); + DEFSYM (Qmwheel_scroll, "mwheel-scroll"); DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function, doc: /* Non-nil means call as function to display a help buffer. This eliminates all the delay I formerly saw while mouse scrolling as fast as possibly. -- Alan Mackenzie (Nuremberg, Germany).