Discussion:
bug#26525: `sit-for' in Flyspell slows typing down, hogs 90% of CPU
(too old to reply)
Damien Cassou
2017-10-17 12:07:58 UTC
Permalink
I have attached a profile in which Flyspell's flyspell-check-word-p
consumes 89% of CPU time while typing text in a buffer. […]
This happened to me in the past then stopped for months. Now it happens
again and is really annoying. Emacs regularly freezes for around 5
seconds when I manipulate text.
--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Stefan Kangas
2020-08-13 01:41:18 UTC
Permalink
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.
Indeed, there was only a profile; I don't have a good repro yet. In that case, flyspell was slowing things down a lot, and the complaint was indeed about delays.
Sorry for being unclear.
That was 3 years ago. Are you still seeing this on a recent version of
Emacs, such as the recently released 27.1?

Best regards,
Stefan Kangas
Stefan Kangas
2020-08-28 11:49:08 UTC
Permalink
Post by Damien Cassou
I have attached a profile in which Flyspell's flyspell-check-word-p
consumes 89% of CPU time while typing text in a buffer. […]
This happened to me in the past then stopped for months. Now it happens
again and is really annoying. Emacs regularly freezes for around 5
seconds when I manipulate text.
That was 3 years ago. Are you still seeing this on a recent version of
Emacs, such as the recently released 27.1?

Best regards,
Stefan Kangas
Damien Cassou
2020-08-28 12:35:58 UTC
Permalink
Post by Stefan Kangas
That was 3 years ago. Are you still seeing this on a recent version of
Emacs, such as the recently released 27.1?
This hasn't happened for some time.
--
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Clément Pit-Claudel
2020-08-28 18:40:07 UTC
Permalink
Post by Damien Cassou
Post by Stefan Kangas
That was 3 years ago. Are you still seeing this on a recent version of
Emacs, such as the recently released 27.1?
This hasn't happened for some time.
There was a report of a similar issue on reddit recently, but it hasn't happened to me of late.
Stefan Kangas
2020-08-29 16:27:29 UTC
Permalink
tags 26525 + unreproducible
thanks
Post by Clément Pit-Claudel
Post by Damien Cassou
Post by Stefan Kangas
That was 3 years ago. Are you still seeing this on a recent version of
Emacs, such as the recently released 27.1?
This hasn't happened for some time.
There was a report of a similar issue on reddit recently, but it hasn't happened to me of late.
You wouldn't happen to have a link to the relevant thread? I tried
searching the web but couldn't find anything.

I'm marking this bug as unreproducible for now. Please report back if
you see this again or can provide any more information.
Clément Pit-Claudel
2020-08-29 18:10:01 UTC
Permalink
Post by Stefan Kangas
You wouldn't happen to have a link to the relevant thread? I tried
searching the web but couldn't find anything.
https://www.reddit.com/r/emacs/comments/i96lbo/flyspell_consuming_most_of_my_resources_why_oo/ , sorry for not including it the first time.
Nick H
2020-09-02 23:15:50 UTC
Permalink
Post by Stefan Kangas
I'm marking this bug as unreproducible for now. Please report back
if you see this again or can provide any more information.
I just bumped into this bug on 27.1 with the same symptoms - typing lag
after activating flyspell-mode.

I took a couple of profiles - the first when lag was apparent and
another after clearing the lag by toggling flyspell-mode.

Both profiles show a similar result, so the "high cpu" in sit-for might
be a red-herring.

Profile 1 - with lag
- flyspell-post-command-hook 1146 92%
- flyspell-check-word-p 1120 90%
- sit-for 1117 90%
- redisplay 551 44%
+ redisplay_internal (C function) 1 0%
read-event 390 31%
- flyspell-get-not-casechars 1 0%
ispell-get-decoded-string 1 0%
+ flyspell-word 8 0%
+ flyspell-check-pre-word-p 3 0%
+ command-execute 65 5%
+ ... 22 1%
+ undo-auto--add-boundary 1 0%

Profile 2 - without lag
- flyspell-post-command-hook 3507 94%
- flyspell-check-word-p 3432 92%
- sit-for 3414 92%
- redisplay 1660 44%
+ redisplay_internal (C function) 3 0%
+ read-event 1317 35%
+ ispell-get-otherchars 6 0%
+ flyspell-get-not-casechars 5 0%
+ flyspell-word 17 0%
+ flyspell-check-pre-word-p 13 0%
+ command-execute 93 2%
+ ... 87 2%
+ timer-event-handler 3 0%
undo-auto--add-boundary 2 0%
tooltip-hide 1 0%

Nick
Stefan Kangas
2020-09-03 10:19:10 UTC
Permalink
Post by Nick H
I just bumped into this bug on 27.1 with the same symptoms - typing lag
after activating flyspell-mode.
What is your ispell/flyspell configuration?

Do you have any ideas about how to reproduce it, or could you say
something about the circumstances under which you saw this?

Loading...