From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3 Date: Sat, 4 Apr 2020 17:07:48 -0700 Organization: UCLA Computer Science Department Message-ID: References: <86tv2h2vww.fsf@gmail.com> <20200322123818.GB32470@ACM> <87eetk5swm.fsf@gnu.org> <20200326193128.GC14092@ACM> <86d08y4zsx.fsf@gmail.com> <83sghs7qdz.fsf@gnu.org> <83h7y63sjj.fsf@gnu.org> <834ku43c61.fsf@gnu.org> <83k12zz6ds.fsf@gnu.org> <054393f3-3873-ab6e-b325-0eca354d8838@gmx.at> <29a6c120-f260-0ea3-f5e0-1d3dd6323d09@gmx.at> <5752c978-3a13-4e09-18b3-14201eaf1083@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------BEE21FD5E61577DAF72839CC" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73908"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: emacs-devel@gnu.org To: martin rudalics , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 05 02:08:26 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 1jKspu-000J9J-17 for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Apr 2020 02:08:26 +0200 Original-Received: from localhost ([::1]:43228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKspt-0002Qr-3r for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Apr 2020 20:08:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48098) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKspN-000210-Kp for emacs-devel@gnu.org; Sat, 04 Apr 2020 20:07:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKspM-0003J9-EA for emacs-devel@gnu.org; Sat, 04 Apr 2020 20:07:53 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jKspM-0003G3-4T for emacs-devel@gnu.org; Sat, 04 Apr 2020 20:07:52 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 75F2916012A; Sat, 4 Apr 2020 17:07:50 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id rjGnHVDBgSge; Sat, 4 Apr 2020 17:07:49 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 67B2F16012C; Sat, 4 Apr 2020 17:07:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5wIGlwaC0OtD; Sat, 4 Apr 2020 17:07:49 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1665F16012A; Sat, 4 Apr 2020 17:07:48 -0700 (PDT) In-Reply-To: <5752c978-3a13-4e09-18b3-14201eaf1083@gmx.at> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 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:246433 Archived-At: This is a multi-part message in MIME format. --------------BEE21FD5E61577DAF72839CC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 4/4/20 1:55 AM, martin rudalics wrote: > >=C2=A0 > The basic slowness of Emacs over the past years is a direct = consequence > >=C2=A0 > of that policy. > > > > How many users is that true for? When Emacs is slow for me, it's usu= ally=20 > because of very long lines. Is that the same issue, or a different one? >=20 > As mentioned in my answer to Stefan the most recent issue I noticed is > that mouse-wheel scrolling buffers for xdisp.c and dispextern.h consume= s > 100% of my CPU and still takes some ten seconds to complete. I looked into this, and although it's no doubt fundamentally due to a slo= w=20 algorithm, the slowness is exacerbated if you use -Og (which you appear t= o be=20 using). Stefan's recent message hinted at this. I installed the attached = into=20 master to try to fix the -Og issue; please give it a try. The slow algorithm should be fixed too, but I'm no expert there. > > Is that the Black Edition 5000+ or the regular one? The Black Editio= n was=20 > quite the thing in 2007. :-) >=20 > How would I find out? Your BIOS right after cycling power, I expect. It's not high priority to = find=20 out. As I vaguely recall the main advantage of the Black Edition is that = you=20 could overclock, and if you had a Black Edition my next suggestion was go= ing to=20 be a joke that you should overclock your ancient and slow CPU to make you= r Emacs=20 faster.... --------------BEE21FD5E61577DAF72839CC Content-Type: text/x-patch; charset=UTF-8; name="gcc-Og-patch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc-Og-patch.diff" diff --git a/src/Makefile.in b/src/Makefile.in index 552dd2e50a..dfd322553b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -377,11 +377,14 @@ pdmp := # Flags that might be in WARN_CFLAGS but are not valid for Objective C. NON_OBJC_CFLAGS = -Wignored-attributes -Wignored-qualifiers -Wopenmp-simd +# Cajole GCC into inlining key ops even if it wouldn't normally. +KEY_OPS_CFLAGS = $(if $(filter -Og,$(CFLAGS)),-DDEFINE_KEY_OPS_AS_MACROS) + # -Demacs makes some files produce the correct version for use in Emacs. # MYCPPFLAGS is for by-hand Emacs-specific overrides, e.g., # "make MYCPPFLAGS='-DDBUS_DEBUG'". -EMACS_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ - -I$(lib) -I$(top_srcdir)/lib \ +EMACS_CFLAGS = -Demacs $(KEY_OPS_CFLAGS) $(MYCPPFLAGS) \ + -I. -I$(srcdir) -I$(lib) -I$(top_srcdir)/lib \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \ $(PNG_CFLAGS) $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \ diff --git a/src/lisp.h b/src/lisp.h index f223814d8f..7fc3af992e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -411,15 +411,19 @@ #define lisp_h_XHASH(a) XUFIXNUM_RAW (a) # define lisp_h_XTYPE(a) ((enum Lisp_Type) (XLI (a) & ~VALMASK)) #endif -/* When compiling via gcc -O0, define the key operations as macros, as - Emacs is too slow otherwise. To disable this optimization, compile - with -DINLINING=false. */ -#if (defined __NO_INLINE__ \ - && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__ \ - && ! (defined INLINING && ! INLINING)) -# define DEFINE_KEY_OPS_AS_MACROS true -#else -# define DEFINE_KEY_OPS_AS_MACROS false +/* When DEFINE_KEY_OPS_AS_MACROS, define key operations as macros to + cajole the compiler into inlining them; otherwise define them as + inline functions as this is cleaner and can be more efficient. + The default is true if the compiler is GCC-like and if function + inlining is disabled because the compiler is not optimizing or is + optimizing for size. Otherwise the default is false. */ +#ifndef DEFINE_KEY_OPS_AS_MACROS +# if (defined __NO_INLINE__ \ + && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__) +# define DEFINE_KEY_OPS_AS_MACROS true +# else +# define DEFINE_KEY_OPS_AS_MACROS false +# endif #endif #if DEFINE_KEY_OPS_AS_MACROS --------------BEE21FD5E61577DAF72839CC--