From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: larsi@gnus.org, emacs-devel@gnu.org, gregory@heytings.org
Subject: Re: How the long-lines "optimisation" breaks font locking.
Date: Fri, 05 Aug 2022 14:20:39 +0300 [thread overview]
Message-ID: <837d3n0we0.fsf@gnu.org> (raw)
In-Reply-To: <Yuz3VI5vXnBpUNqa@ACM> (message from Alan Mackenzie on Fri, 5 Aug 2022 10:56:20 +0000)
> Date: Fri, 5 Aug 2022 10:56:20 +0000
> Cc: larsi@gnus.org, emacs-devel@gnu.org, gregory@heytings.org
> From: Alan Mackenzie <acm@muc.de>
>
> > > Having loaded the file in C++ Mode (without the spiking of
> > > narrow-to-region and widen), it took 90 seconds for M-> (first time).
>
> > And you consider that reasonable?
>
> No, it wasn't reasonable, but neither was it "hang indefinitely".
Many/most users would never wait for 90 seconds for such a simple
command. So yes, it's "indefinitely" for all practical purposes.
(And imagine how long it would take in an unoptimized build that I'm
running every day.)
> The problem was a single font-lock clause, after whose removal, the M->
> took about 1 second (first time) in the file with a 1,000,000 long line.
> This clause can be put back into CC Mode and optimised, probably by
> checking for being inside a literal.
>
> All the other sluggishness has also vanished with that change. I still
> get the overflow in the regexp engine stack on inserting text. That,
> again, is a bug that surely can be fixed.
Thanks. Any improvements in font-lock of any major mode is welcome.
If/when enough of them get their act together, we might revisit the
default value of long-line-threshold, as I already said many times.
I also encourage the interested parties to submit changes to extend
'widen' so that it could optionally break the lock. Then we could
allow using that option in modes whose font-lock is not misbehaving
with long lines.
next prev parent reply other threads:[~2022-08-05 11:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 18:39 How the long-lines "optimisation" breaks font locking Alan Mackenzie
2022-08-03 19:03 ` Lars Ingebrigtsen
2022-08-04 10:44 ` Alan Mackenzie
2022-08-04 12:54 ` Eli Zaretskii
2022-08-04 14:44 ` Alan Mackenzie
2022-08-04 14:52 ` Lars Ingebrigtsen
2022-08-04 15:22 ` Gregory Heytings
2022-08-05 1:23 ` Ihor Radchenko
2022-08-04 16:09 ` Eli Zaretskii
2022-08-05 10:56 ` Alan Mackenzie
2022-08-05 11:20 ` Eli Zaretskii [this message]
2022-08-05 13:04 ` Dmitry Gutov
2022-08-05 14:22 ` Eli Zaretskii
2022-08-05 14:29 ` Dmitry Gutov
2022-08-05 15:30 ` Eli Zaretskii
2022-08-05 19:50 ` Dmitry Gutov
2022-08-06 5:36 ` Eli Zaretskii
2022-08-06 10:54 ` Dmitry Gutov
2022-08-04 13:11 ` Eric S Fraga
2022-08-04 13:34 ` Po Lu
2022-08-04 14:38 ` Eric S Fraga
2022-08-04 16:16 ` SOLVED: " Eric S Fraga
2022-08-04 16:21 ` Eric S Fraga
2022-08-04 17:36 ` Stefan Kangas
2022-08-05 9:36 ` Eric S Fraga
2022-08-05 11:13 ` Eli Zaretskii
2022-08-05 12:28 ` Eric S Fraga
2022-08-05 13:40 ` Eric S Fraga
2022-08-05 23:11 ` Tim Cross
2022-08-05 23:23 ` Lars Ingebrigtsen
2022-08-08 11:51 ` Fraga, Eric
2022-08-03 19:15 ` Eli Zaretskii
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=837d3n0we0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=gregory@heytings.org \
--cc=larsi@gnus.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 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.