GNU bug report logs -
#11757
24.1.50; vc-git calls `process-file' too many times
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Thu, 21 Jun 2012 02:17:02 UTC
Severity: normal
Found in version 24.1.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 06.07.2012 17:44, Michael Albinus wrote:
> Dmitry Gutov <dgutov <at> yandex.ru> writes:
>
>>> If we assume that there are no dangerous vc commands outside Emacs, we
>>> wouldn't have a problem.
>>
>> In this case, the behavior of the first patch I posted here should be
>> acceptable, right? It's simpler, has pretty much the same effect, and
>> should be a tiny bit faster.
>
> That I don't know. Both patches do almost what we expect, and having a
> cached value for `vc-registered' sounds more performant when applied
> often enough.
With the attached patch, `vc-git-registered' is usually called only once
during the lifetime of a buffer.
For caching to be an improvement, 'git-registered value has to be
invalidated separately from 'vc-backend, yet less often than
`vc-git-state' is called.
>>> Yes. I don't know, whether we will be able to handle any surprise when
>>> using caches. There will always be a scenario which lets fail a given
>>> algorithm. I fear.
>>
>> Sure, but I'm just asking for one scenario that works better with
>> explicitly caching 'git-registered, instead of not calling it in
>> vc-git-state'.
>> If `vc-git-state' doesn't call `vc-git-registered' (just assumes it's
>> t), then `vc-registered' is the latter's only client, and so its
>> return value is implicitly cached in 'vc-backend property.
>
> Maybe. Could you show a patch? (Please with ChangeLog entry, I would
> commit if it looks good).
* vc-git.el (vc-git-state): Don't call `vc-git-registered', assume it's
always t.
(vc-git-registered): Remove caching, the function is only called once.
Thank you,
--Dmitry
[vc-git-registered.diff (text/plain, attachment)]
This bug report was last modified 12 years and 362 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.