HeadlinesBriefing favicon HeadlinesBriefing.com

Speed Up Emacs Consult Async Searches

Hacker News •
×

The Emacs Consult package offers asynchronous search commands like consult-fd and consult-grep, but they may feel slower than Counsel due to intentional debounce and throttle delays. These delays prevent excessive background process starts and UI refreshes, balancing responsiveness with CPU usage. To make searches feel snappier, users can adjust three variables: consult-async-input-debounce (wait time after typing before starting a process), consult-async-input-throttle (minimum interval between process starts), and consult-async-refresh-delay (how often results update).

Setting these to lower values, such as 0.05 seconds for debounce and refresh, and 0.1 seconds for throttle, reduces perceived latency, especially on fast machines. However, this increases CPU load and may cause more frequent redraws. The defaults are conservative to protect laptop battery life.

Users should experiment to find a balance that suits their hardware and preferences.