GNU bug report logs - #24048
25.0.95; syntax-ppss can be slow

Previous Next

Package: emacs;

Reported by: Aaron Jensen <aaronjensen <at> gmail.com>

Date: Thu, 21 Jul 2016 14:31:02 UTC

Severity: normal

Tags: moreinfo

Found in version 25.0.95

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #34 received at 24048 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Aaron Jensen <aaronjensen <at> gmail.com>
Cc: 24048 <at> debbugs.gnu.org
Subject: Re: bug#24048: 25.0.95; syntax-ppss can be slow
Date: Fri, 03 Dec 2021 12:01:41 -0500
> In certain situations, the caching of syntax-ppss can seem to be
> insufficient for good performance when syntax-ppss is invoked in
> a tight loop.

Yes, that's a known limitation.  Most uses of `syntax-ppss` that need to
call it in a tight loop move the call outside of the loop and then use
`parse-partial-sexp` inside the loop (and they're careful to move
forward so `parse-partial-sexp` is only called between the last
position and the current one so we avoid re-parsing the same text).

Currently `syntax-ppss` assumes that parsing <2500 chars is "fast
enough" and hence that it's better not to update the "last ppss data"
when this happens (the advantage is that we save time not-updating the
data and we also save time if the next call is somewhere within those
<2500 chars).


        Stefan





This bug report was last modified 3 years and 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.