From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Thinking about changed buffers Date: Mon, 28 Mar 2016 17:43:39 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1459201457 12263 80.91.229.3 (28 Mar 2016 21:44:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2016 21:44:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 28 23:44:08 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1akexA-0008WH-PL for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2016 23:44:04 +0200 Original-Received: from localhost ([::1]:43040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akex6-0005KC-Hn for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2016 17:44:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akews-0005Jx-OQ for emacs-devel@gnu.org; Mon, 28 Mar 2016 17:43:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akewp-00030g-IY for emacs-devel@gnu.org; Mon, 28 Mar 2016 17:43:46 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:34904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akewp-00030Z-D9 for emacs-devel@gnu.org; Mon, 28 Mar 2016 17:43:43 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id u2SLiErM018993; Mon, 28 Mar 2016 17:44:14 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 09EA766184; Mon, 28 Mar 2016 17:43:39 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Mon, 28 Mar 2016 21:27:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5625=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5625> : inlines <4598> : streams <1610396> : uri <2175072> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202366 Archived-At: >> 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