unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Olivier Scalbert <olivier.scalbert@algosyn.com>
To: Alan Mackenzie <acm@muc.de>
Cc: "Mattias Engdegård" <mattiase@acm.org>, 42490@debbugs.gnu.org
Subject: bug#42490: Emacs is very slow when navigating into a specific C++ file
Date: Mon, 21 Sep 2020 19:29:28 +0200	[thread overview]
Message-ID: <2b34ae1e-c4ee-9176-206d-4ac98708c606@algosyn.com> (raw)
In-Reply-To: <20200921090639.GA6379@ACM>

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 <acm@muc.de>
>>> 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.






  reply	other threads:[~2020-09-21 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  7:45 bug#42490: Emacs is very slow when navigating into a specific C++ file Olivier Scalbert
2020-07-24 16:46 ` Mattias Engdegård
2020-07-24 19:24   ` Alan Mackenzie
2020-07-24 19:34     ` Olivier Scalbert
2020-09-21  9:06       ` Alan Mackenzie
2020-09-21 17:29         ` Olivier Scalbert [this message]
2020-09-22 10:03           ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b34ae1e-c4ee-9176-206d-4ac98708c606@algosyn.com \
    --to=olivier.scalbert@algosyn.com \
    --cc=42490@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=mattiase@acm.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).