emacs-devel
[Top][All Lists]
Advanced

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

Re: New optimisations for long raw strings in C++ Mode.


From: Lars Ingebrigtsen
Subject: Re: New optimisations for long raw strings in C++ Mode.
Date: Sun, 07 Aug 2022 15:34:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Alan Mackenzie <acm@muc.de> writes:

> Hmm.  Something is different on my setup from yours.  After my
> optimisations, I do:

Is this on the current trunk?

> (i) Emacs -Q
> (ii) M-: (setq long-line-threshold nil)
> (ii) C-x C-f ~/long-line.cc RET; This is a file containing a 1MB raw
>   string.
> (iii) This loads and displays in somewhere between 1 and 2 seconds.
> (iv) C-x 5 b long-line2.cc RET  M-x c++-mode RET
> (v) Type in char long_line [] = R"foo(
> (vi) Type in RET, twice
> (vii) Type in )foo";

Yup.

> (ix) C-x 5 o
> (x) Get the long line into the kill ring, with movement commands and
>   M-w.
> (xi) C-x 5 o.
> (xii) Put point on the blank line 2.
> (xiii) C-y.
> (xiv) This takes less than a second to display.

It's still hanging for me after 20s.

> What does your 1MB string look like?  Does it contain lots of "s?  CC
> Mode needs to search through the yanked line for the first occurrence of
> )foo", which is why it is not instantaneous.  It also has to put a
> syntax-table text property on each " which isn't the terminating )foo",
> which is another reason it's not instantaneous.

The string I'm yanking is just 1MB worth of x and y characters (and no
spaces or anything).



reply via email to

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