When I type in a large (1000+ lines, tens of thousands of words) Markdown buffer, the typing feels slow. My profiler reports this
Memory
Bytes % Function
14,151,043 33% + flyspell-post-command-hook
11,394,237 27% + corfu--post-command
8,081,767 19% + command-execute
8,069,640 19% + redisplay_internal (C function)
CPU
Samples % Function
1032 27% + flyspell-post-command-hook
740 19% + corfu--post-command
676 17% + redisplay_internal (C function)
653 17% + ...
My config for Flyspell and Corfu is
;; Corfu
(use-package corfu
:custom
(corfu-auto t)
(corfu-auto-prefix 1)
(corfu-auto-delay 0.1)
:init
(global-corfu-mode)
(corfu-history-mode))
;;Flyspell
(add-hook 'flyspell-mode-hook
(lambda ()
(setq flyspell-issue-message-flag nil)
(flyspell-buffer)))
How can I address this bottleneck? I've tried narrowing the buffer, but it seems to change nothing.