consult-grep (with ripgrep or ugrep) is slower than counsel-rg #951
-
counsel-rg is much faster than consult. In fact, counsel-rg mostly feels realtime to me (especially when the query has more than around 10 characters)(without the
I have used consult with ugrep as well, and that also has this problem. This makes me believe that the bottleneck is with consult itself. Perhaps using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
Consult update delays can be adjusted with consult-async-* variables. It could be that you perceive Consult as slower since it doesn't restart the search as often. For a meaningful comparison more information is needed and a recipe based on emacs -Q. Did you try to capture a profile? See https://github.com/minad/consult?tab=readme-ov-file#bug-reports. |
Beta Was this translation helpful? Give feedback.
Thanks!
I gave
consult--async-refresh-timer
another critical look and the implementation was indeed not good, since it repeated the refreshing at a certain interval.I don't recall exactly why I implemented this in that way, but I suspect that I wanted to avoid unnecessary timer restarts and allocations. The idea was to only set the
refresh
variable when new candidates come in, and then refresh the display from the timer if therefresh
variable is set. For large delays this works well, but for small delays the cost of unnecessarily executing the timer repeatedly dominates.I have now replaced this with an optimized implementation where the timer is restarted when necessary and not repeated (