-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process indicator as part of the lighter #3
Comments
Ah, cool idea. That one I agree will require some caching. |
I've experimented with this, but at least in normal circumstances the busy state is so short that it just causes a little flicker in the mode line. Only if I set the wrong language in order to get lots of misspellings I see some fun stuff going on. So it looks like this is not a practical feature to provide. |
Did you try stealth mode? |
I've created a branch with the mode line counter: https://github.com/astoff/jit-spell/tree/modeline-counter. I maintain my impression this is not a useful thing for the user, but it's interesting for debugging. I noticed that without stealth mode, jit-lock does what you expect: fontify the area near the window and then stop. On the other hand, enabling stealth mode causes even a 1 character change in a comment to trigger many checks. I suppose you're getting the entire buffer refontified eventually. |
Maybe I should just give up on stealth mode. I believe it is nice for font locking only. But still, I think #9 should be fixed. jit-spell has an efficiency problem, which I find hard to justify for a mode which I turn on everywhere. |
Out of curiosity, why did you turn stealth mode on in the first place? |
I've seen it recommended somewhere as a performance optimization (maybe Doom Emacs, could be just cargo culting). So far I never observed bad side effects of it. But maybe it is a useless optimization, since I find it also hard to observe positive effects. :-P But even if I disable stealth locking, jit-spell is still loading my system too heavily. Aspell takes around 3% and Emacs takes 90%. Without jit-spell this does not happen. |
Can you reproduce on |
Yes, I see the high load of Emacs with the following snippet starting from (package-initialize)
(add-hook 'prog-mode-hook 'jit-spell-mode)
;; Causes high load until the whole buffer is fontified.
(setq jit-lock-stealth-time 0.01 ;; aggressive, not my actual setting
jit-lock-stealth-nice 0.01 ;; aggressive, not my actual setting
jit-lock-stealth-load 100
jit-lock-chunk-size 3000)
;; Reduce load of aspell ~1%. Emacs is high > 90%.
(setq ispell-extra-args '("--sug-mode=ultra"))
;; Doesn't seem to make a difference.
;; (setq read-process-output-max (* 64 1024)) EDIT: I can reproduce this pretty reliably if I open (package-initialize)
;; Causes high load until the whole buffer is fontified.
;; All of the settings are overly aggressive.
(setq jit-lock-stealth-time 0.01
jit-lock-stealth-nice 0.01
jit-lock-stealth-load 1000
jit-lock-chunk-size 10000)
;; Reduce load of aspell ~1%. Emacs is high > 90%.
(setq ispell-extra-args '("--sug-mode=ultra")) |
On a tangent, the mode line seems to ignore the text properties returned from an |
Since we've got this lighter, would it make sense to add a process indicator there too, which tells if jit-spell is active or not? The indicator should be implemented such that it doesn't introduce movement of the mode line or flickering. See for example the indicator in
consult-ripgrep
which switches from:
to*
and back, such that the prompt doesn't move.The text was updated successfully, but these errors were encountered: