[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thinking about changed buffers

From: Lars Magne Ingebrigtsen
Subject: Re: Thinking about changed buffers
Date: Mon, 28 Mar 2016 21:27:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>   if (BUF_SAVE_MODIFF (buf) == BUF_MODIFF (buf))
>>     return Qnil;
> This test basically never succeeds except when we already know the file
> in not modified.

It's to avoid having the hashing function being called several times in
a row if you happen to have the "original size" in the buffer.  It's
what makes this hash only being called the first time per ... time.  :-)

>> we can short circuit the hash calculation like, almost always.  It would
>> only be necessary (the first time per ... time) the buffer reaches the
>> same size that it used to be.
> Still seems problematic if your 5 year old takes 2.7s to compute it on
> a 1GB file.  You don't want to freeze for 2s in the normal course of
> editing just because you happen to cross the "original size" threshold.

Yeah, I don't see any way around that.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]