[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24048: 25.0.95; syntax-ppss can be slow
From: |
Aaron Jensen |
Subject: |
bug#24048: 25.0.95; syntax-ppss can be slow |
Date: |
Thu, 2 Dec 2021 21:38:07 -0500 |
On Wed, Dec 1, 2021 at 2:47 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Aaron Jensen <aaronjensen@gmail.com> writes:
>
> > 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)))))))
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> This bit is now:
>
> (if (and old-pos (< (- pos old-pos)
> ;; The time to use syntax-begin-function and
> ;; find PPSS is assumed to be about 2 * distance.
> (let ((pair (aref syntax-ppss-stats 5)))
> (/ (* 2 (cdr pair)) (car pair)))))
>
> I.e., the last clause is gone. I don't know whether this affects the
> issue you were seeing, though. Is syntax-ppss still mis-caching things
> for you?
I can still reproduce it with the specified repro:
Load
https://gist.githubusercontent.com/aaronjensen/d4cd40347a916dd36c8239afecf64a7d/raw/b52440bb51b96193a365a7f4cc1c8733ba98476f/syntax-ppss-slow-repro.ex
Install and enable elixir-mode
At top of file:
M-: (benchmark 100 '(syntax-ppss))
On line 71:
M-: (benchmark 100 '(syntax-ppss))
For me it's 0.1ms vs 5ms
Aaron
- bug#24048: 25.0.95; syntax-ppss can be slow, Lars Ingebrigtsen, 2021/12/01
- bug#24048: 25.0.95; syntax-ppss can be slow,
Aaron Jensen <=
- bug#24048: 25.0.95; syntax-ppss can be slow, Stefan Monnier, 2021/12/03
- bug#24048: 25.0.95; syntax-ppss can be slow, Aaron Jensen, 2021/12/03
- bug#24048: 25.0.95; syntax-ppss can be slow, Lars Ingebrigtsen, 2021/12/03
- bug#24048: 25.0.95; syntax-ppss can be slow, Dmitry Gutov, 2021/12/04
- bug#24048: 25.0.95; syntax-ppss can be slow, Aaron Jensen, 2021/12/04
- bug#24048: 25.0.95; syntax-ppss can be slow, Dmitry Gutov, 2021/12/04
- bug#24048: 25.0.95; syntax-ppss can be slow, Aaron Jensen, 2021/12/05