From: Alan Mackenzie <acm@muc.de>
To: Bastian Beischer <bastian.beischer@gmail.com>
Cc: 30367@debbugs.gnu.org
Subject: bug#30367: 26.0.91; CC-Mode: Major slowdown when isearching big C++ file.
Date: 7 Feb 2018 15:24:35 -0000 [thread overview]
Message-ID: <20180207152435.72040.qmail__17037.1282998987$1518017018$gmane$org@mail.muc.de> (raw)
In-Reply-To: <mailman.8662.1517913372.27995.bug-gnu-emacs@gnu.org>
Hello, Bastian.
In article <mailman.8662.1517913372.27995.bug-gnu-emacs@gnu.org> you wrote:
> After updating CC-Mode to the latest version in the standalone mercurial
> repository I noticed that searching large C++ files has become a lot
> slower than before (factor 20 or so).
Thanks for taking the trouble to report this bug.
How large is large? Any chance you could supply me with such a sample
C++ file that is slow on searching. Then, in case something else
besides the size is slowing it down, I'll have a "working" file to
diagnose the bug with.
> I traced the problem back to this commit:
> Author: Alan Mackenzie <bug-cc-mode@gnu.org>
> Date: Sun Jan 21 18:05:41 2018 +0000
> Handle C99 Compound Literals in return statements and argument lists.
>
> * cc-engine.el (c-looking-at-or-maybe-in-bracelist): Recognize a brace list
> when preceded by "return" or inside parentheses, either immediately after the
> "(" or following a comma.
> (c-looking-at-inexpr-block): Test c-has-compound-literals rather than hard
> coded C++ Mode.
> (c-guess-basic-syntax, CASE 7B): Test additionally for not being just inside a
> parenthesis or being at a Java "new" keyword. CASE 9: Remove the simple
> minded test on the contents of a block to determine a brace list.
>
> * cc-langs.el (c-has-compound-literals): New lang const and lang var.
>
> * bracelist-30.{c,res}: New test files.
Thanks for getting this information. This should help track down the
problem.
> I am attaching the result of a run of the emacs profiler before
> ("fast.profile") and after the commit ("slow.profile"). In this run I
> started emacs as:
> emacs -Q /path/to/big/file.C -e "(add-to-list 'load-path ~/cc-mode)" -e "(require 'cc-mode)"
> M-x profiler-start
> C-s searchString
> M-x profiler-report
> And write the result to 'slow.profile' and 'fast.profile'
> respectively. It appears that 93% of the time is spent in
> c-looking-at-or-maybe-in-bracelist.
> Thanks for looking into this issue!
Just as a matter of interest, you can post CC Mode bugs direct to
bug-cc-mode@gnu.org. Sometimes a CC Mode dump produced by C-c C-b can
be useful, though I don't think it would help much here.
> In GNU Emacs 26.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
> of 2018-02-06 built on beischer-w520
> Repository revision: c787a4968273027960a20ced6d63bae0d1ffa87e
> Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
[ .... ]
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2018-02-07 15:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 10:34 bug#30367: 26.0.91; CC-Mode: Major slowdown when isearching big C++ file Bastian Beischer
2018-02-06 10:40 ` Bastian Beischer
[not found] ` <mailman.8662.1517913372.27995.bug-gnu-emacs@gnu.org>
2018-02-07 15:24 ` Alan Mackenzie [this message]
[not found] ` <20180207152435.72040.qmail@mail.muc.de>
2018-02-07 15:27 ` Bastian Beischer
2018-02-07 21:21 ` Alan Mackenzie
[not found] ` <20180207212145.GA3963@ACM>
2018-02-07 21:53 ` Bastian Beischer
2018-02-07 22:26 ` Alan Mackenzie
2018-02-07 22:45 ` Bastian Beischer
2018-02-08 17:25 ` Alan Mackenzie
[not found] ` <20180208172558.GA4335@ACM>
2018-02-08 18:42 ` Alan Mackenzie
[not found] ` <20180208184232.GB4335@ACM>
2018-02-09 9:16 ` Bastian Beischer
2018-03-20 18:49 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='20180207152435.72040.qmail__17037.1282998987$1518017018$gmane$org@mail.muc.de' \
--to=acm@muc.de \
--cc=30367@debbugs.gnu.org \
--cc=bastian.beischer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.