bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30367: 26.0.91; CC-Mode: Major slowdown when isearching big C++ file


From: Alan Mackenzie
Subject: bug#30367: 26.0.91; CC-Mode: Major slowdown when isearching big C++ file.
Date: 7 Feb 2018 15:24:35 -0000
User-agent: tin/2.4.1-20161224 ("Daill") (UNIX) (FreeBSD/11.1-RELEASE-p4 (amd64))

Hello, Bastian.

In article <address@hidden> 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 <address@hidden>
> 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
address@hidden  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).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]