Subject: bug#24048: 25.0.95; syntax-ppss can be slow

From: Dmitry Gutov <[email-masked]>
Date: Mon, 25 Jul 2016 15:42:22 +0300

On 07/25/2016 10:12 AM, Aaron Jensen wrote:

> Sure, just use elixir-mode and this
> file https://gist.githubusercontent.com/aaronjensen/d4cd40347a916dd36c8239afecf64a7d/raw/b52440bb51b96193a365a7f4cc1c8733ba98476f/syntax-ppss-slow-repro.ex
>
> Then do: (benchmark 100 '(syntax-ppss)) at the top of the file and
> compare it to doing it within the `chunk_by` function at the bottom of
> the file. For me it’s 0.2ms at the top and 5.6ms at the bottom.
> Smartparens can do 50-100 syntax-ppss calls for every
> self-insert-command, and 5.6ms is significant latency to add on to every
> keypress.

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.