• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


01 Dec, 2024

Updated at 12 Dec, 2024

Typing in large markdown buffers is slow due to corfu and flyspell. How to address?

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.