Hasty Briefsbeta

Bilingual

Why Emacs Consult async searches feel slow and how to speed them up

20 days ago
  • Consult provides asynchronous search commands (e.g., consult-fd, consult-find, consult-grep) with configurable debounce, throttle, and refresh delays to control process spawning and UI updates.
  • The default delays are conservative to reduce CPU usage; they can be made more aggressive (e.g., debounce 0.05s, throttle 0.1s, refresh 0.05s) for lower latency at the cost of higher resource consumption.
  • Debouncing waits for a quiet period after the last keystroke before starting a search, preventing redundant processes for intermediate characters.
  • Throttling imposes a strict rate limit on how often new asynchronous processes are launched, regardless of typing speed.
  • The refresh delay controls how frequently the completion UI is updated with new results; lower values make results appear faster but increase Emacs redisplay cost.
  • Aggressive settings are best for fast, plugged-in computers; on laptops or slow machines, defaults may provide a better balance to avoid battery drain and unnecessary searches.
  • Optimal delay values depend on typing speed, project size, search tool performance, power constraints, and the cost of processing asynchronous results.