From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'. Date: Sat, 12 Mar 2016 19:36:26 +0000 Message-ID: <20160312193626.GA10781@acm.fritz.box> References: <20160308183010.GB6269@acm.fritz.box> <20160309174816.GE3948@acm.fritz.box> <56E0805F.3050804@gmx.at> <20160312170839.GE2572@acm.fritz.box> <56E45B90.3090905@gmx.at> <56E45E72.2010801@cs.ucla.edu> <56E4640F.1000808@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457811261 32025 80.91.229.3 (12 Mar 2016 19:34:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2016 19:34:21 +0000 (UTC) Cc: Paul Eggert , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 12 20:34:06 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 1aepIb-0004cn-RR for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2016 20:34:06 +0100 Original-Received: from localhost ([::1]:33174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aepIb-0000b6-2e for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2016 14:34:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aepIO-0000aq-1i for emacs-devel@gnu.org; Sat, 12 Mar 2016 14:33:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aepIK-0003fB-Rt for emacs-devel@gnu.org; Sat, 12 Mar 2016 14:33:51 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:52700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aepIK-0003ei-J5 for emacs-devel@gnu.org; Sat, 12 Mar 2016 14:33:48 -0500 Original-Received: (qmail 10395 invoked by uid 3782); 12 Mar 2016 19:33:46 -0000 Original-Received: from acm.muc.de (p548A446C.dip0.t-ipconnect.de [84.138.68.108]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 12 Mar 2016 20:33:45 +0100 Original-Received: (qmail 18375 invoked by uid 1000); 12 Mar 2016 19:36:26 -0000 Content-Disposition: inline In-Reply-To: <56E4640F.1000808@gmx.at> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 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:201547 Archived-At: On Sat, Mar 12, 2016 at 07:46:39PM +0100, martin rudalics wrote: > > Possibly you're seeing the effect of emacs-25 commit > > 7352c6c695db8b90b63c2601277d64a32507d2bb, which was merged to master > > only in commit 63efcc268635dea78c6bd80749eae4ee2c72d717 (within the > > past 24 hours). If your master predates the later commit that could > > explain the symptoms you're seeing. > I now repeated the experiments with latest master and still see the > results I mentioned earlier. That is, with the functions I gave > earlier, the release branch is faster than master by a factor of 20! > Could someone try to repeat with master _and_ release and post the > results? > (defun foo () > (interactive) > (while (not (eobp)) > (c-end-of-defun))) > (defun bar () > (interactive) > (while (not (bobp)) > (c-beginning-of-defun))) OK. Here are my timings. Just for the record I time things with this macro: (defmacro time-it (&rest forms) "Time the running of a sequence of forms using `float-time'. Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"." `(let ((start (float-time))) ,@forms (- (float-time) start))) , rather than with elp, which will make my times a bit less. I've timed `foo' and `bar' on optimised builds in the emacs-25 branch and the comment-cache branch (incorporating the patch I posted earlier). Here are the timings in seconds: emacs-25 comment-cache foo 2.535 1.651 bar 13.685 1.620 These timings (apart from `bar' on emacs-25) are surely acceptable. There's one subtlety about the comment-cache branch: I've now renamed `comment-depth' (etc.) to `literal-cache' (etc.), and set `literal-cacheing-flag' (renamed from `comment-cacheing-flag') to t by default. However, I've only just committed the corresponding required change to CC Mode, so this might have a bearing on your timings. Other than that, I can't explain what's going on with your timings. > (defun foofoo () > (interactive) > (elp-instrument-function 'c-end-of-defun) > (goto-char (point-min)) > (foo) > (elp-results)) > (defun foobar () > (interactive) > (elp-instrument-function 'c-beginning-of-defun) > (goto-char (point-max)) > (bar) > (elp-results)) Just for the record: emacs-25 comment-cache foofoo 2.545 1.643 foobar 13.729 1.642 > (find-file-noselect "../src/xdisp.c") > (switch-to-buffer-other-window "xdisp.c") > And in xdisp.c's window do M-x foofoo and M-x foobar. > Thanks, martin -- Alan Mackenzie (Nuremberg, Germany).