Subject: bug#74243: [PATCH] Speed up vc-hg-state by treating ignored files as unregistered

From: Sean Whitton <[email-masked]>
Date: Fri, 29 Nov 2024 16:17:33 +0800

Hello,

On Wed 27 Nov 2024 at 02:18am +02, Dmitry Gutov wrote:

> Maybe Sean's idea is better, but to spitball different options:
>
> - FWIW since not too long ago we've treated a similar issue in diff-hl by
>   using a thread - which calls the same code inside (meaning the current
>   synchronous implementation), but it happens in the background, so the input
>  is unfrozen and the visual update is asynchronous.
>
> But keeping in mind that threads' error handling is not great, so it seems not
> optimal to keep a lot of implementation code inside a thread. Also, threads
> are reportedly not good with remote calls yet.
>
> - The mode-line update isn't going to wait asynchronously, though, but perhaps
>   an update could be scheduled. If state updates are not synchronous, I
>   suppose this would also need some debouncing/queueing mechanism for the
>   callers as well. That is the route of migrating to a different calling
>  convention, though.

Thanks for these ideas.

Spencer, do you mind if I close this bug?  It's clear that we could be
doing something better here, but given the news from Hg upstream, we
probably don't want to make changes along the lines of your original
patch.

> - Finally, if the main scenario that we are concerned is the use in vc-dir, we
>   could try switching only its updates to another backend
>   call. E.g. vc-dir-resynch-file would switch to the (possibly) more precise -
>   though slower - dir-status-files, just like the code that first populates
>  that buffer. vc-state could then afford shortcuts more safely.

Just to note, my concern was that vc-state is a public function and we
don't know where it's being used, so vc-dir is not the main concern.

-- 
Sean Whitton