logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

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

Original article
jamescherti.com|8 points|1 comments|by mpweiher|Sep 9, 2026

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:

  1. Debounce delays: Controls the wait time after input.
  2. Throttle delays: Limits the frequency of process initiation.
  3. 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 ripgrep or fd run faster. 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.

Detailed Variable Breakdown

VariableRoleImpact of Lowering Value
consult-async-input-debounceIdle timer after keystrokeSearch starts sooner after you stop typing.
consult-async-input-throttleHard rate limitIncreases the maximum frequency of new searches.
consult-async-refresh-delayUI update frequencyResults 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:

Responsiveness∝1Delay Value  ⟹  CPU/Battery Cost↑\text{Responsiveness} \propto \frac{1}{\text{Delay Value}} \implies \text{CPU/Battery Cost} \uparrowResponsiveness∝Delay Value1​⟹CPU/Battery Cost↑

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.

Software Engineer with Laptop

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.