From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33670: 26.1; very large c++-mode yank performance regression 25.3_1-x86_64 -> 26.1-x86_64 Date: Sat, 08 Dec 2018 09:49:20 +0200 Message-ID: <83bm5w5ugv.fsf@gnu.org> References: <647599b2-0aae-8654-a662-a8142dd360d2@d6.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1544255293 14487 195.159.176.226 (8 Dec 2018 07:48:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Dec 2018 07:48:13 +0000 (UTC) Cc: 33670@debbugs.gnu.org To: Chris Hecker Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 08 08:48:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVXLK-0003bT-JO for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2018 08:48:06 +0100 Original-Received: from localhost ([::1]:49875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVXNR-0003fc-0B for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2018 02:50:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVXNG-0003f4-Vk for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 02:50:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVXNC-0002uN-PQ for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 02:50:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVXNC-0002tC-Kh for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 02:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gVXNC-0001G6-EY for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 02:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Dec 2018 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33670 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33670-submit@debbugs.gnu.org id=B33670.15442553914817 (code B ref 33670); Sat, 08 Dec 2018 07:50:02 +0000 Original-Received: (at 33670) by debbugs.gnu.org; 8 Dec 2018 07:49:51 +0000 Original-Received: from localhost ([127.0.0.1]:37530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVXN0-0001Fd-W5 for submit@debbugs.gnu.org; Sat, 08 Dec 2018 02:49:51 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVXMz-0001FQ-B1 for 33670@debbugs.gnu.org; Sat, 08 Dec 2018 02:49:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVXMo-0001Xr-Vs for 33670@debbugs.gnu.org; Sat, 08 Dec 2018 02:49:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVXMo-0001Xa-QP; Sat, 08 Dec 2018 02:49:38 -0500 Original-Received: from [176.228.60.248] (port=2156 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gVXMo-0003gh-Dt; Sat, 08 Dec 2018 02:49:38 -0500 In-reply-to: <647599b2-0aae-8654-a662-a8142dd360d2@d6.com> (message from Chris Hecker on Fri, 7 Dec 2018 18:42:23 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:153203 Archived-At: > From: Chris Hecker > Date: Fri, 7 Dec 2018 18:42:23 -0800 > > If I start emacs and visit a moderately large cpp file (18k LOC), and go > to the same place in the middle of the file in both versions of emacs, > then kill and yank the current line, the performance on 26.1 is easily > 10x worse...the yank is instant in 25.3_1 and takes literally almost a > second on 26.1 sometimes. I decided to test this with a profiler run, > so I went to the same line in both, killed the line, and evaled this: > > (progn (profiler-start 'cpu) (yank) (profiler-report) (profiler-stop)) > > Here are the results: > > 25.3_1: > > - ... 1 100% > Automatic GC 1 100% > > > 26.1: > - command-execute 14 100% > - call-interactively 14 100% > - funcall-interactively 14 100% > - eval-expression 14 100% > - eval 14 100% > - progn 14 100% > - yank 14 100% > - insert-for-yank 14 100% > - insert-for-yank-1 14 100% > - c-after-change 13 92% > - mapc 13 92% > - # 13 92% > - c-after-change-re-mark-raw-strings 6 42% > - c-in-literal 3 21% Please load cc-mode.el manually as a .el file, and then do this experiment again and show the profile. As you see from the above, most of the time is taken by some function in the c-before-font-lock-functions, but it's hard to tell which, because it is shown as a byte code. Emacs 26 puts 5 functions on c-before-font-lock-functions, whereas Emacs 25 used only 2, and it's IMO important to see which one(s) take the lion's share of time. Also, do you see this kind of degradation in any C++ source file of comparable size, or is that particular file you used for the profile especially slow? Finally, was the line you yanked a line of code or a part of a comment (or some other syntactic element)? Does that matter? Thanks.