Skip to content

consult-grep (with ripgrep or ugrep) is slower than counsel-rg #951

Answered by minad
NightMachinery asked this question in Q&A
Discussion options

You must be logged in to vote

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 the refresh 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 (

Replies: 1 comment 16 replies

Comment options

You must be logged in to vote
16 replies
@oantolin
Comment options

@minad
Comment options

@NightMachinery
Comment options

@minad
Comment options

Answer selected by NightMachinery
@NightMachinery
Comment options

@minad
Comment options

@NightMachinery
Comment options

@minad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #950 on February 24, 2024 00:17.