Why Emacs Consult async searches feel slow and how to speed them up
Optimizing the Perceived Speed of Asynchronous Searches in Emacs Consult
The consult package for Emacs offers a suite of powerful asynchronous search tools, including consult-ripgrep, consult-fd, consult-grep, consult-find, and consult-git-grep. While highly functional, some users find the initial experience slightly "laggy."
The Perception of Latency
When first switching from a package like Counsel, you might notice a subtle hesitation. While Counsel updates results almost instantly upon every keystroke, Consult appears to pause for a fraction of a second before the list refreshes. This is similar to the perceived delay some users feel with settings like show-paren-delay.
This isn't because the search tools themselves are slow; rather, it is due to how Consult manages the communication between the Emacs minibuffer and the external search processes.
The Mechanism of Control
Consult manages asynchronous processes using three primary levers:
- Debounce delays: Controls the wait time after input.
- Throttle delays: Limits the frequency of process initiation.
- Refresh delays: Determines how often the UI updates with new data.
How to Implement "Aggressive" Search Settings
If you prioritize instantaneous feedback over resource conservation, you can modify the following variables in your configuration:
(setq consult-async-input-debounce 0.05
consult-async-input-throttle 0.1
consult-async-refresh-delay 0.05)
These settings make They do not. External tools are already highly optimized and multi-threaded. Instead, these variables optimize the internal Emacs feedback loop by reducing the time spent waiting to spawn processes and redrawing the screen.ripgrep or fd run faster.
Detailed Variable Breakdown
| Variable | Role | Impact of Lowering Value |
|---|---|---|
consult-async-input-debounce | Idle timer after keystroke | Search starts sooner after you stop typing. |
consult-async-input-throttle | Hard rate limit | Increases the maximum frequency of new searches. |
consult-async-refresh-delay | UI update frequency | Results appear in the completion UI more rapidly. |
1. consult-async-input-debounce
Setting this to 0.05 means Consult waits 50 milliseconds after your last keypress before triggering a search. Because it is a debounce timer, every new character resets the clock. This prevents the system from wasting CPU cycles on intermediate search terms while you are in the middle of typing a word.
2. consult-async-input-throttle
The throttle acts as a ceiling. Even if you trigger the debounce timer repeatedly, the throttle ensures a new process is spawned at most once every 0.1 seconds.
The difference visualized:
3. consult-async-refresh-delay
This controls the interval (e.g., 0.05 seconds) at which Consult pushes new results to the UI. It only triggers when there is actually new data to show. However, because Emacs redisplay is computationally expensive, very low values can lead to increased CPU usage and more frequent garbage collection.
Choosing Your Configuration
The decision to lower these delays is essentially a mathematical trade-off:
Which settings should you use?
- Aggressive Settings: Best for high-performance desktops plugged into power. Provides the lowest possible input latency.
- Default Settings: Best for laptops (to preserve battery) or older hardware.
- Conservative Settings: Best for massive projects where spawning too many processes could overwhelm the system.

Final Thoughts
The optimal configuration depends on your specific hardware, typing speed, and the size of the projects you index. As noted by Minad, the author of Consult, in GitHub issue #951:
"I did not determine the defaults in a scientific way based on measurements. A detailed analysis wi..."
Ultimately, reducing these delays is an explicit choice to exchange system resources for a snappier, more immediate user interface.