From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 23 06:59:03 2020 Received: (at submit) by debbugs.gnu.org; 23 Jul 2020 10:59:03 +0000 Received: from localhost ([127.0.0.1]:44160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyYwJ-0001L6-28 for submit@debbugs.gnu.org; Thu, 23 Jul 2020 06:59:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:56398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyVuz-0004oQ-0E for submit@debbugs.gnu.org; Thu, 23 Jul 2020 03:45:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyVuy-00023c-K0 for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2020 03:45:28 -0400 Received: from maverick.wznoc.com ([67.222.128.248]:35464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyVuv-0002dT-OT for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2020 03:45:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=algosyn.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:From:Subject:To:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tfLn8Cv0nN+VTbGiTLLLfLE+Ejs8eaVZ/+xYuuVEpg4=; b=Q8oyn7uKoNnTn+9v4l64jfv8Tk mKOPypb+LdCuQJapiIt3+YE7MwGA+qluAfGwmqH9ruFNM6haezfh2heNoaGJzaHSXfqhm23dkYogi VsKOL+n+hwZ1T1sCceUxi9T8SSNjpb+blRt1dNmRWEv+rK8lckciBJMBM7YlkuEn1DlT5HSnrWD3U VaOsyxivG/1FJ7jfsUPvkjVDWcBBcmYI/21rT1Upm3nEv75GVG8NpWKkcmWlXdFfaZXtTlSsaKUWn 15Pv79hJp1iMTUVBmnHLBpusBAH35CAq2+x1nnWFSiJjyt8Mv3Qz2wv0gc7Ww9sKJ4Mrvcah5r4+n c31zyF7Q==; Received: from [109.130.219.96] (port=53336 helo=[192.168.1.59]) by maverick.wznoc.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jyVur-0006LP-7q for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2020 02:45:21 -0500 To: bug-gnu-emacs@gnu.org Subject: Emacs is very slow when navigating into a specific C++ file From: Olivier Scalbert Message-ID: <11f564eb-74f1-980b-53e3-2de64abe62e0@algosyn.com> Date: Thu, 23 Jul 2020 09:45:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - maverick.wznoc.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - algosyn.com X-Get-Message-Sender-Via: maverick.wznoc.com: authenticated_id: olivier.scalbert@algosyn.com X-Authenticated-Sender: maverick.wznoc.com: olivier.scalbert@algosyn.com X-Source: X-Source-Args: X-Source-Dir: Received-SPF: pass client-ip=67.222.128.248; envelope-from=olivier.scalbert@algosyn.com; helo=maverick.wznoc.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/23 03:45:22 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 23 Jul 2020 06:59:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi ! With Emacs 26.1 or 26.3 on my Xeon Debian box, I have some problems with the following C++ file: https://github.com/mamedev/mame/blob/master/src/devices/cpu/z80/z80.cpp (which is part of the Mame project). When I open it and press several times the "page down" key, Emacs seems to hang. In fact 100% of the cpu is consumed during 10 to 15 seconds. Then it works well. My Emacs config is nearly empty. The C++ code is a little special as is contains lot of macros, but I can open it and navigate into it without problem with vim or VSCode. If I turn off syntax highlighting, it run smoother. Thanks for the help ! Olivier In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-09-23, modified by Debian built on x86-grnet-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Recent messages: Loading /etc/emacs/site-start.d/50gnugo.el (source)...done Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)... Loading /usr/share/emacs/site-lisp/latex-cjk-common/cjk-enc.el (source)...done Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done Loading /etc/emacs/site-start.d/50openscad.el (source)...done Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... [2 times] Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-StqULU/emacs-26.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/26.1/lisp/textmodes/rst /usr/share/emacs/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/26.1/lisp/language/thai-word Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair solarized-dark-theme solarized color dash finder-inf info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 282823 12891) (symbols 48 28411 2) (miscs 40 50 76) (strings 32 78429 1210) (string-bytes 1 1842487) (vectors 16 21905) (vector-slots 8 611952 8270) (floats 8 277 315) (intervals 56 282 0) (buffers 992 12)) From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 24 12:46:59 2020 Received: (at 42490) by debbugs.gnu.org; 24 Jul 2020 16:47:00 +0000 Received: from localhost ([127.0.0.1]:48652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz0qZ-0000jZ-Mp for submit@debbugs.gnu.org; Fri, 24 Jul 2020 12:46:59 -0400 Received: from mail157c50.megamailservers.eu ([91.136.10.167]:34384 helo=mail51c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz0qY-0000jR-4R for 42490@debbugs.gnu.org; Fri, 24 Jul 2020 12:46:59 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1595609210; bh=Zo/uolf6gQ3e9yV/yOliLMfMWFIt062vr+qtTOfOQQc=; h=From:Subject:Date:Cc:To:From; b=AlVyzogoxNmBHbB2o0ciJImZjpW7bByqeEBddmVwT8qmLKgD2u2dLKRO68olChCvs AjRwHVxTkDyjgCP08yeNZSWwPE1rf7aBSbKMblBEarNMNWmzR4mNDdmwbZ0DhhuDAE AxEE+7Y/gAZrBioFWYmwLGot3uqagEH+KUPOwcfQ= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 06OGkjYC001989; Fri, 24 Jul 2020 16:46:48 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: bug#42490: Emacs is very slow when navigating into a specific C++ file Message-Id: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> Date: Fri, 24 Jul 2020 18:46:45 +0200 To: Olivier Scalbert X-Mailer: Apple Mail (2.3445.104.15) X-CTCH-RefID: str=0001.0A782F26.5F1B107A.0001:SCFSTAT68638221, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=MOMeZ/Rl c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=yeK0Hb666i2x0e7VDMQA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 42490 Cc: Alan Mackenzie , 42490@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello Olivier, Thanks for the report! Could you try Emacs 27 (or git master), building = from source if necessary? Those versions should be slightly faster, = although the response time is probably well below acceptable. If we distill the essentials of your file to some sort of benchmark, we = might end up with: (with-temp-buffer (c++-mode) (dotimes (_ 1000) (insert "OP(ed,b0) { ldir(); } /* LDIR */\n")) (garbage-collect) (let ((t0 (current-time))) (font-lock-ensure (point-min) (point-max)) (time-to-seconds (time-since t0)))) Emacs 26.3 runs it in 11.9 s on this old lappy, but Emacs 27 does it in = 3.3 s. This is a clear improvement but we should be able to do better. = Alan may have a feeling for where the cycles are spent. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 24 15:25:03 2020 Received: (at 42490) by debbugs.gnu.org; 24 Jul 2020 19:25:03 +0000 Received: from localhost ([127.0.0.1]:48744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz3JW-0004bI-Np for submit@debbugs.gnu.org; Fri, 24 Jul 2020 15:25:02 -0400 Received: from colin.muc.de ([193.149.48.1]:41566 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jz3JS-0004ah-DO for 42490@debbugs.gnu.org; Fri, 24 Jul 2020 15:25:01 -0400 Received: (qmail 97683 invoked by uid 3782); 24 Jul 2020 19:24:51 -0000 Received: from acm.muc.de (p4fe15eb0.dip0.t-ipconnect.de [79.225.94.176]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Fri, 24 Jul 2020 21:24:51 +0200 Received: (qmail 9072 invoked by uid 1000); 24 Jul 2020 19:24:51 -0000 Date: Fri, 24 Jul 2020 19:24:50 +0000 To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= , Olivier Scalbert Subject: Re: bug#42490: Emacs is very slow when navigating into a specific C++ file Message-ID: <20200724192450.GA8811@ACM> References: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42490 Cc: 42490@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Mattias and Olivier. Firstly Olivier, thanks for taking the trouble to report the bug. On Fri, Jul 24, 2020 at 18:46:45 +0200, Mattias Engdegård wrote: > Hello Olivier, > Thanks for the report! Could you try Emacs 27 (or git master), building > from source if necessary? Those versions should be slightly faster, > although the response time is probably well below acceptable. > If we distill the essentials of your file to some sort of benchmark, we > might end up with: > (with-temp-buffer > (c++-mode) > (dotimes (_ 1000) > (insert "OP(ed,b0) { ldir(); } /* LDIR */\n")) > (garbage-collect) > (let ((t0 (current-time))) > (font-lock-ensure (point-min) (point-max)) > (time-to-seconds (time-since t0)))) > Emacs 26.3 runs it in 11.9 s on this old lappy, but Emacs 27 does it in > 3.3 s. This is a clear improvement but we should be able to do better. > Alan may have a feeling for where the cycles are spent. I've bisected CC Mode to find the critical change, and it is: commit cc80eeb4a43d2079963de3d181002a6a6b56560d Author: Alan Mackenzie Date: Fri Apr 12 20:07:03 2019 +0000 Analyze C++ method with & or && ref-qualifier as defun, not brace list Also firm up detection of beginning of brace list in c-looking-at-or-maybe-in-bracelist. I have a simple benchmark which scrolls through a file, fontifying it, and my results from this benchmark are: (i) Before applying that patch: 53.022s. (ii) After applying that patch: 7.039s. I don't understand at the moment why that patch sped up scrolling in your (Olivier's) file, but it would seem the patch is most desirable. Unfortunately, the patch won't apply cleanly to the Emacs 26.3 sources. It might be possible to find a sequence of patches which would do the job. I think (though I haven't checked) the patch will have been included in the upcoming Emacs 27.1 release. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 24 18:29:48 2020 Received: (at 42490) by debbugs.gnu.org; 24 Jul 2020 22:29:48 +0000 Received: from localhost ([127.0.0.1]:48880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz6CJ-0000er-EP for submit@debbugs.gnu.org; Fri, 24 Jul 2020 18:29:48 -0400 Received: from maverick.wznoc.com ([67.222.128.248]:36606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz3TB-0004qY-GE for 42490@debbugs.gnu.org; Fri, 24 Jul 2020 15:35:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=algosyn.com ; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=k4OrHUC2ElfEiYop/zJAfjRJqH9+UihO6EiqA88MLr4=; b=BSnQfNpj3dXTry+QMPUwLc21h3 2uQ8790aeXZboBOKZDcn1zjvbwblFEEWNFowaJp630uUetqmz++BbK1gfG2LZzA5hAGrAJsge7WPz m6JkbU2EZp8QFRcCTqmExtfVcx4hwnuZbZiL7dOFyOXJ0lK7z6PSEh+VeyKGGQlwrav+ndXjPV0g8 s7HNjsyeyo5HwYOGws01K+eP3YOAa4agp/FU3NXJQI+IFnNGakz1iBHa4eK2gGXrr2MK21lhaBxWr r0O87FTyoiMYCVfiO/vTEAZ/cZIEBNNbW3NhlxGXnt7WQmGErebYO4aM6GBFUpTzRQ1BWo2rT/yjU j2hnoDHw==; Received: from [109.130.219.96] (port=47538 helo=[192.168.1.59]) by maverick.wznoc.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jz3T4-0000EF-Sp; Fri, 24 Jul 2020 14:34:55 -0500 Subject: Re: bug#42490: Emacs is very slow when navigating into a specific C++ file To: Alan Mackenzie , =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= References: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> <20200724192450.GA8811@ACM> From: Olivier Scalbert Message-ID: <1b3a22e8-859f-b839-74cb-1905a8298b52@algosyn.com> Date: Fri, 24 Jul 2020 21:34:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200724192450.GA8811@ACM> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - maverick.wznoc.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - algosyn.com X-Get-Message-Sender-Via: maverick.wznoc.com: authenticated_id: olivier.scalbert@algosyn.com X-Authenticated-Sender: maverick.wznoc.com: olivier.scalbert@algosyn.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 42490 X-Mailman-Approved-At: Fri, 24 Jul 2020 18:29:46 -0400 Cc: 42490@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi, Thanks for your answer. Unfortunately, I am out of my home, with no PC, for the week-end. If I'll survive, I will test it next Monday. Very sorry ! ;-) Regards, Olivier On 7/24/20 9:24 PM, Alan Mackenzie wrote: > Hello, Mattias and Olivier. > > Firstly Olivier, thanks for taking the trouble to report the bug. > > On Fri, Jul 24, 2020 at 18:46:45 +0200, Mattias EngdegÃ¥rd wrote: >> Hello Olivier, >> Thanks for the report! Could you try Emacs 27 (or git master), building >> from source if necessary? Those versions should be slightly faster, >> although the response time is probably well below acceptable. >> If we distill the essentials of your file to some sort of benchmark, we >> might end up with: >> (with-temp-buffer >> (c++-mode) >> (dotimes (_ 1000) >> (insert "OP(ed,b0) { ldir(); } /* LDIR */\n")) >> (garbage-collect) >> (let ((t0 (current-time))) >> (font-lock-ensure (point-min) (point-max)) >> (time-to-seconds (time-since t0)))) >> Emacs 26.3 runs it in 11.9 s on this old lappy, but Emacs 27 does it in >> 3.3 s. This is a clear improvement but we should be able to do better. >> Alan may have a feeling for where the cycles are spent. > I've bisected CC Mode to find the critical change, and it is: > > commit cc80eeb4a43d2079963de3d181002a6a6b56560d > Author: Alan Mackenzie > Date: Fri Apr 12 20:07:03 2019 +0000 > > Analyze C++ method with & or && ref-qualifier as defun, not brace list > > Also firm up detection of beginning of brace list in > c-looking-at-or-maybe-in-bracelist. > > I have a simple benchmark which scrolls through a file, fontifying it, > and my results from this benchmark are: > (i) Before applying that patch: 53.022s. > (ii) After applying that patch: 7.039s. > > I don't understand at the moment why that patch sped up scrolling in your > (Olivier's) file, but it would seem the patch is most desirable. > > Unfortunately, the patch won't apply cleanly to the Emacs 26.3 sources. > It might be possible to find a sequence of patches which would do the > job. I think (though I haven't checked) the patch will have been > included in the upcoming Emacs 27.1 release. > From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 21 05:06:49 2020 Received: (at 42490) by debbugs.gnu.org; 21 Sep 2020 09:06:49 +0000 Received: from localhost ([127.0.0.1]:53447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKHmb-0002LV-9C for submit@debbugs.gnu.org; Mon, 21 Sep 2020 05:06:49 -0400 Received: from colin.muc.de ([193.149.48.1]:14102 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kKHmZ-0002LC-BE for 42490@debbugs.gnu.org; Mon, 21 Sep 2020 05:06:48 -0400 Received: (qmail 26247 invoked by uid 3782); 21 Sep 2020 09:06:40 -0000 Received: from acm.muc.de (p4fe15e13.dip0.t-ipconnect.de [79.225.94.19]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 21 Sep 2020 11:06:39 +0200 Received: (qmail 6432 invoked by uid 1000); 21 Sep 2020 09:06:39 -0000 Date: Mon, 21 Sep 2020 09:06:39 +0000 To: Olivier Scalbert Subject: Re: bug#42490: Emacs is very slow when navigating into a specific C++ file Message-ID: <20200921090639.GA6379@ACM> References: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> <20200724192450.GA8811@ACM> <1b3a22e8-859f-b839-74cb-1905a8298b52@algosyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1b3a22e8-859f-b839-74cb-1905a8298b52@algosyn.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: 42490 Cc: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= , 42490@debbugs.gnu.org, acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Hello, Olivier. Ping? On Fri, Jul 24, 2020 at 21:34:51 +0200, Olivier Scalbert wrote: > Hi, > Thanks for your answer. > Unfortunately, I am out of my home, with no PC, for the week-end. > If I'll survive, I will test it next Monday. Very sorry ! > ;-) Emacs 27.1 was released just a few weeks ago. Maybe you're already using it. I think CC Mode processes the test file fast enough on 27.1, so it's probably time to close this bug. What do you say? > Regards, > Olivier > On 7/24/20 9:24 PM, Alan Mackenzie wrote: > > Hello, Mattias and Olivier. > > Firstly Olivier, thanks for taking the trouble to report the bug. > > On Fri, Jul 24, 2020 at 18:46:45 +0200, Mattias Engdegård wrote: > >> Hello Olivier, > >> Thanks for the report! Could you try Emacs 27 (or git master), building > >> from source if necessary? Those versions should be slightly faster, > >> although the response time is probably well below acceptable. > >> If we distill the essentials of your file to some sort of benchmark, we > >> might end up with: > >> (with-temp-buffer > >> (c++-mode) > >> (dotimes (_ 1000) > >> (insert "OP(ed,b0) { ldir(); } /* LDIR */\n")) > >> (garbage-collect) > >> (let ((t0 (current-time))) > >> (font-lock-ensure (point-min) (point-max)) > >> (time-to-seconds (time-since t0)))) > >> Emacs 26.3 runs it in 11.9 s on this old lappy, but Emacs 27 does it in > >> 3.3 s. This is a clear improvement but we should be able to do better. > >> Alan may have a feeling for where the cycles are spent. > > I've bisected CC Mode to find the critical change, and it is: > > commit cc80eeb4a43d2079963de3d181002a6a6b56560d > > Author: Alan Mackenzie > > Date: Fri Apr 12 20:07:03 2019 +0000 > > Analyze C++ method with & or && ref-qualifier as defun, not brace list > > Also firm up detection of beginning of brace list in > > c-looking-at-or-maybe-in-bracelist. > > I have a simple benchmark which scrolls through a file, fontifying it, > > and my results from this benchmark are: > > (i) Before applying that patch: 53.022s. > > (ii) After applying that patch: 7.039s. > > I don't understand at the moment why that patch sped up scrolling in your > > (Olivier's) file, but it would seem the patch is most desirable. > > Unfortunately, the patch won't apply cleanly to the Emacs 26.3 sources. > > It might be possible to find a sequence of patches which would do the > > job. I think (though I haven't checked) the patch will have been > > included in the upcoming Emacs 27.1 release. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 21 14:12:21 2020 Received: (at 42490) by debbugs.gnu.org; 21 Sep 2020 18:12:21 +0000 Received: from localhost ([127.0.0.1]:56138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKQIU-0004DY-Qp for submit@debbugs.gnu.org; Mon, 21 Sep 2020 14:12:21 -0400 Received: from maverick.wznoc.com ([67.222.128.248]:50116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKPdB-0003AT-Vd for 42490@debbugs.gnu.org; Mon, 21 Sep 2020 13:29:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=algosyn.com ; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FbGCvy0fEZeH/hwCiIz/GOkjYvFcaIeLKvuQ2RhQ+3U=; b=j/+FFsp3aZ2dwr4CyPuDgb3hsZ Zo8VLp/JKjtoJAa9AAfPOt9Xut1Nl9BSp0Ftv384ehWNI/USaIAATchiMprnzzbajYahKYDeIXJLB eE3716llmdl0pJXQU3cVPhaKkhtkBKu5+ugIbHjWpPXZfjLnAoZ/Ma3rUg8TOR62dCU524pWjP1NV b5LawFJeaSM9xyHH+wcAdBgQijC0qYpRcnwsApG02D5st788k0gm6O1+3p8uVRnpEsVNhBNkA8sRG NUw6MZ36ap/1oZDhojnTOYVri4fFEnFvPq8Y6QQNP+zu5lXzgxYpY76OzTPxE5jN+NL6aPUS5Jqdn vbg62pTw==; Received: from [109.130.219.96] (port=55674 helo=[192.168.1.59]) by maverick.wznoc.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kKPd5-00088i-A7; Mon, 21 Sep 2020 12:29:31 -0500 Subject: Re: bug#42490: Emacs is very slow when navigating into a specific C++ file To: Alan Mackenzie References: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> <20200724192450.GA8811@ACM> <1b3a22e8-859f-b839-74cb-1905a8298b52@algosyn.com> <20200921090639.GA6379@ACM> From: Olivier Scalbert Message-ID: <2b34ae1e-c4ee-9176-206d-4ac98708c606@algosyn.com> Date: Mon, 21 Sep 2020 19:29:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200921090639.GA6379@ACM> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - maverick.wznoc.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - algosyn.com X-Get-Message-Sender-Via: maverick.wznoc.com: authenticated_id: olivier.scalbert@algosyn.com X-Authenticated-Sender: maverick.wznoc.com: olivier.scalbert@algosyn.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 42490 X-Mailman-Approved-At: Mon, 21 Sep 2020 14:12:17 -0400 Cc: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= , 42490@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Alan, Ping reply ! ;-) I was sure I had already answered. Sorry for that. With a fresh compile of Emacs 27.1, it is effectively faster than before. So, for me, you can close the bug. Many thanks ! Regards, Olivier On 9/21/20 11:06 AM, Alan Mackenzie wrote: > Hello, Olivier. > > Ping? > > On Fri, Jul 24, 2020 at 21:34:51 +0200, Olivier Scalbert wrote: >> Hi, >> Thanks for your answer. >> Unfortunately, I am out of my home, with no PC, for the week-end. >> If I'll survive, I will test it next Monday. Very sorry ! >> ;-) > Emacs 27.1 was released just a few weeks ago. Maybe you're already > using it. > > I think CC Mode processes the test file fast enough on 27.1, so it's > probably time to close this bug. What do you say? > >> Regards, >> Olivier > > > > > > >> On 7/24/20 9:24 PM, Alan Mackenzie wrote: >>> Hello, Mattias and Olivier. >>> Firstly Olivier, thanks for taking the trouble to report the bug. >>> On Fri, Jul 24, 2020 at 18:46:45 +0200, Mattias EngdegÃ¥rd wrote: >>>> Hello Olivier, >>>> Thanks for the report! Could you try Emacs 27 (or git master), building >>>> from source if necessary? Those versions should be slightly faster, >>>> although the response time is probably well below acceptable. >>>> If we distill the essentials of your file to some sort of benchmark, we >>>> might end up with: >>>> (with-temp-buffer >>>> (c++-mode) >>>> (dotimes (_ 1000) >>>> (insert "OP(ed,b0) { ldir(); } /* LDIR */\n")) >>>> (garbage-collect) >>>> (let ((t0 (current-time))) >>>> (font-lock-ensure (point-min) (point-max)) >>>> (time-to-seconds (time-since t0)))) >>>> Emacs 26.3 runs it in 11.9 s on this old lappy, but Emacs 27 does it in >>>> 3.3 s. This is a clear improvement but we should be able to do better. >>>> Alan may have a feeling for where the cycles are spent. >>> I've bisected CC Mode to find the critical change, and it is: >>> commit cc80eeb4a43d2079963de3d181002a6a6b56560d >>> Author: Alan Mackenzie >>> Date: Fri Apr 12 20:07:03 2019 +0000 >>> Analyze C++ method with & or && ref-qualifier as defun, not brace list >>> Also firm up detection of beginning of brace list in >>> c-looking-at-or-maybe-in-bracelist. >>> I have a simple benchmark which scrolls through a file, fontifying it, >>> and my results from this benchmark are: >>> (i) Before applying that patch: 53.022s. >>> (ii) After applying that patch: 7.039s. >>> I don't understand at the moment why that patch sped up scrolling in your >>> (Olivier's) file, but it would seem the patch is most desirable. >>> Unfortunately, the patch won't apply cleanly to the Emacs 26.3 sources. >>> It might be possible to find a sequence of patches which would do the >>> job. I think (though I haven't checked) the patch will have been >>> included in the upcoming Emacs 27.1 release. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 21 14:55:06 2020 Received: (at control) by debbugs.gnu.org; 21 Sep 2020 18:55:06 +0000 Received: from localhost ([127.0.0.1]:56205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKQxt-0005GZ-NO for submit@debbugs.gnu.org; Mon, 21 Sep 2020 14:55:05 -0400 Received: from colin.muc.de ([193.149.48.1]:39229 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kKQxs-0005Fs-0z for control@debbugs.gnu.org; Mon, 21 Sep 2020 14:55:05 -0400 Received: (qmail 46927 invoked by uid 3782); 21 Sep 2020 18:54:57 -0000 Received: from acm.muc.de (p4fe15e13.dip0.t-ipconnect.de [79.225.94.19]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 21 Sep 2020 20:54:56 +0200 Received: (qmail 11239 invoked by uid 1000); 21 Sep 2020 18:54:57 -0000 Date: Mon, 21 Sep 2020 18:54:56 +0000 To: control@debbugs.gnu.org Subject: Bug 42490. Message-ID: <20200921185456.GB6379@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 42490 27.1 quit -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 22 06:03:52 2020 Received: (at 42490) by debbugs.gnu.org; 22 Sep 2020 10:03:52 +0000 Received: from localhost ([127.0.0.1]:57277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKf9M-0004zo-IZ for submit@debbugs.gnu.org; Tue, 22 Sep 2020 06:03:52 -0400 Received: from colin.muc.de ([193.149.48.1]:14998 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kKf9I-0004zY-L6 for 42490@debbugs.gnu.org; Tue, 22 Sep 2020 06:03:51 -0400 Received: (qmail 48094 invoked by uid 3782); 22 Sep 2020 10:03:41 -0000 Received: from acm.muc.de (p4fe15d08.dip0.t-ipconnect.de [79.225.93.8]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Tue, 22 Sep 2020 12:03:41 +0200 Received: (qmail 27289 invoked by uid 1000); 22 Sep 2020 10:03:41 -0000 Date: Tue, 22 Sep 2020 10:03:41 +0000 To: Olivier Scalbert Subject: Re: bug#42490: Emacs is very slow when navigating into a specific C++ file Message-ID: <20200922100341.GB26819@ACM> References: <8E02A060-9CF0-4B1F-A780-4F51336291FA@acm.org> <20200724192450.GA8811@ACM> <1b3a22e8-859f-b839-74cb-1905a8298b52@algosyn.com> <20200921090639.GA6379@ACM> <2b34ae1e-c4ee-9176-206d-4ac98708c606@algosyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2b34ae1e-c4ee-9176-206d-4ac98708c606@algosyn.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42490 Cc: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= , 42490@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Olivier. On Mon, Sep 21, 2020 at 19:29:28 +0200, Olivier Scalbert wrote: > Hello Alan, > Ping reply ! > ;-) > I was sure I had already answered. Sorry for that. With a fresh compile > of Emacs 27.1, it is effectively faster than before. So, for me, you can > close the bug. Many thanks ! Regards, Olivier Thanks. I've closed the bug now, as fixed in Emacs 27.1. -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Aug 11 18:19:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 20 Oct 2020 11:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator