From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Thinking about changed buffers Date: Mon, 28 Mar 2016 21:27:28 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1459193289 14729 80.91.229.3 (28 Mar 2016 19:28:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2016 19:28:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 28 21:27:59 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 1akcpR-0003mt-CQ for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2016 21:27:57 +0200 Original-Received: from localhost ([::1]:42376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akcpN-0008PW-0K for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2016 15:27:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akcp9-0008P9-FG for emacs-devel@gnu.org; Mon, 28 Mar 2016 15:27:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akcp6-0000pJ-7g for emacs-devel@gnu.org; Mon, 28 Mar 2016 15:27:39 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:43699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akcp6-0000og-1N for emacs-devel@gnu.org; Mon, 28 Mar 2016 15:27:36 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1akcoy-0004RW-DR; Mon, 28 Mar 2016 21:27:30 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEW0Al1XBiWYMFBuDypJ CRmIFDVBCBZgDCRYqWUPAAACMElEQVQ4jWWSQXeiQAzHs9LRa/u6zzMP6p0tgle3TvHKU5ErrUO8 2oLw9TfJDNRu85SB/Cb/ZJIBEAuRba34qRMfYGH9qiXHEXNgYGIfnKlkn2E9wwqmTDa7wQ9AIFIY ARw5JPEHvyqzGqB7pS+vQ2wkJKd/sdzQs8OeP+6I5E5r3/BCMhzDFVx964+Fz8jjNtgd+/ZiI0me 8lNpRnYULcIIDCugrGqJJwcoLdY2iQYokQ4m5tXSmIiTGPAyRFfc7FVALeeXEgalqwCzE5BKIomZ XiyIlQM1KCn7WDsADlRw0AzSk4BzApnNUUGLfMS04oS4TTg7gwiWXLHqLIiTibJSAE98xn13zlhc JSEM4ECVFXt2846iXE8ZUBOWiIdkUTKo4CVsTwQ6euW7EOegDGldAMPMTBjkMs5E01p3Gib4TD6E OaUoST3aSNvX1PT6Q1+OMD+Dt0JpZIempTDEP/gyhXkFXiqAJmu0HTC+ewJkpErTVevttPBtAnNy ZRuZF+IuAHsZqeHzcdx2rBa8kWectgO/pJE+PPLHAa3x+xMrPeRwhZXGwWjXREQfPuF+hjf2rFJZ dQP3x1uAmV30llrizGS3b1tb50+A/wPjOT1Iv8tXNFVj9C04N23X9zQn1Bz9BQJrdKeM7rX+Caj8 bf/xewTnzyCgX2FB3w7gRN0vLiqPuLumicObqqxZUCwgNUMbRqD/NmEAq612wMjTvzNNv4kDKLX+ FpHPKHXTBP8Asp0rd6AX3DMAAAAASUVORK5CYII= In-Reply-To: (Stefan Monnier's message of "Mon, 28 Mar 2016 15:22:09 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.224.195 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:202353 Archived-At: Stefan Monnier 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