GNU bug report logs -
#24048
25.0.95; syntax-ppss can be slow
Previous Next
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
View this message in rfc822 format
On Mon, Jul 25, 2016 at 8:08 AM, Aaron Jensen <aaronjensen <at> gmail.com> wrote:
> On Mon, Jul 25, 2016 at 5:42 AM Dmitry Gutov <dgutov <at> yandex.ru> wrote:
>>
>> Is 5.6ms really significant? You should be typing like 200 characters
>> per _second_ to really notice the difference.
>>
>> Even 12ms that I'm getting at the bottom of your example file doesn't
>> sound like it should have effect on the perceptible latency.
>
> Even if one can’t feel 5.6ms, it becomes another brick in the bag, i.e. if another minor mode did something similar and added another 5.6ms. With enough of them most people could probably feel it.
Hey all, I'm trying to clean up bugs I've submitted. This one is still
an issue of sorts. I've fixed the downstream usage of syntax-ppss by
memoizing it, but that feels like it should be unnecessary given that
syntax-ppss is meant to do its own caching.
The problem here is that syntax-ppss will not update its cache if it
is "close enough" to the old position. In languages like Elixir (and
probably Ruby) the old position is often the beginning of the outer
module which spans most, if not all of the file. This means that the
further you get down the file, the further you get from the old
position and the more work syntax-ppss must do.
If a user of syntax-ppss is not careful (as was the case in
smartparens) then syntax-ppss can be called multiple times in
succession, which can add up to enough latency to be noticed.
Ultimately, it seems like it may be worth reconsidering this condition:
(and old-pos (< (- pos old-pos)
;; The time to use syntax-begin-function and
;; find PPSS is assumed to be about 2 * distance.
(* 2 (/ (cdr (aref syntax-ppss-stats 5))
(1+ (car (aref syntax-ppss-stats 5)))))))
But I do not know what other impacts that may have.
Does anybody have any new thoughts on this?
Thanks!
This bug report was last modified 3 years and 224 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.