Subject: bug#26525: `sit-for' in Flyspell slows typing down, hogs 90% of CPU

From: Eli Zaretskii <[email-masked]>
Date: Mon, 17 Apr 2017 17:25:30 +0300

> Cc: [email-masked]
> From: Clément Pit-Claudel <[email-masked]>
> Date: Mon, 17 Apr 2017 09:29:20 -0400
> 
> On 2017-04-17 03:14, Eli Zaretskii wrote:
> >> But the condition and the comment seem at odds, and it doesn't say much about why it calls `sit-for`.
> > 
> > I'm not quite sure what needs to be explained.  I think the doc string
> > of flyspell-delay and flyspell-default-delayed-commands tell the whole
> > story; if something is unclear there, please say what is unclear.
> 
> The code reads (cond ((get this-command 'flyspell-delayed) …)), but the comment says "The current command is not delayed".  Does a non-nil flycheck-delayed really mean that the command is *not* delayed?

I think the comment should be moved 2 lines below its current place,
that's all.

> > If you want to see this feature in action, turn on Flyspell, then type
> > something like "ssss", and then wait _without_ typing any non-word
> > character.  You will see that the mis-spelled word is marked only
> > after 3 sec, the default value of flyspell-delay.  Then contrast that
> > with the same word with a space typed after it.
> 
> Thanks! I don't expect that this feature is intended to slow down typing, though, right?  In the example I posted it makes typing painfully slow.

I didn't see any example in your OP, only a profile.  What did I miss?

And no, this is not supposed to slow down typing in any significant
way, as long as you type, because sit-for is supposed to return as
soon as input is available.  Your complaint was about CPU usage, not
about time delays, AFAIU.