emacs-devel
[Top][All Lists]
Advanced

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

Re: Thinking about changed buffers


From: Stefan Monnier
Subject: Re: Thinking about changed buffers
Date: Mon, 28 Mar 2016 17:43:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>> 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.

I guess to do better, you'd have to keep track of some bounds of
changes, and to only hash the part of the buffer within those bounds.
E.g. instead of a single hash, keep a list of hash-per-megabyte, plus
a bitmap of touched-megabytes (one bit per megabyte), so you can limit
your check to just those megabytes that have been touched.

This said, it doesn't strike me as a worthwhile exercise.  The benefit
seems very small, and the extra work is out of proportion to that
benefit (and then you have to add the backward incompatibilities this
will inevitably introduce).


        Stefan



reply via email to

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