emacs-devel
[Top][All Lists]
Advanced

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

Re: Processing speed in large C++ raw strings.


From: Dmitry Gutov
Subject: Re: Processing speed in large C++ raw strings.
Date: Fri, 26 Apr 2019 04:25:05 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi Alan,

On 25.04.2019 21:36, Alan Mackenzie wrote:

Some while ago, you were complaining, justifiably, about the
sluggishness when typing characters into very long C++ raw strings.  To
demonstrate this, you put xdisp.c into C++ mode, and put a raw string
round nearly the entire buffer.

It was an argument in a discussion, not exactly a bug report (I don't write C++), but it's laudable progress, of course.

Last week, it was taking over 2 seconds to process a single
self-insert-command into this string, and my machine is not slow.

I have now optimized CC Mode, such that each such self-insert-command
now takes around 0.07s-0.1s.  I used two strategies for this: (i) breaking out
of (expensive) fontification routines early, when the region being
fontified is nothing but a string; (ii) Not fontifying the entire raw
string for a change to only a small part of it.

Pulled the latest changes, rebuilt Emacs and tried this. The result still feels fairly sluggish at times (the pauses seem longer than the timings you mention, especially when I type or delete the relevant double-quote characters), but it should definitely make editing such literals possible and even bearable.

Here's a seemingly related discussion you might be interested in: https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00715.html



reply via email to

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