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: Fri, 11 Mar 2016 18:27:06 +0000 Message-ID: <20160311182706.GE2888@acm.fritz.box> References: <20160308132530.861.91488@vcs.savannah.gnu.org> <20160308183010.GB6269@acm.fritz.box> <20160309174816.GE3948@acm.fritz.box> <56E0805F.3050804@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1457720704 15145 80.91.229.3 (11 Mar 2016 18:25:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2016 18:25:04 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 11 19:24:49 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 1aeRk1-0007ka-8X for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2016 19:24:49 +0100 Original-Received: from localhost ([::1]:57095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeRk0-0001a9-2B for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2016 13:24:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeRjm-0001Zz-Fd for emacs-devel@gnu.org; Fri, 11 Mar 2016 13:24:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeRjh-0004Yf-Bl for emacs-devel@gnu.org; Fri, 11 Mar 2016 13:24:34 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:11357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeRjh-0004XU-5B for emacs-devel@gnu.org; Fri, 11 Mar 2016 13:24:29 -0500 Original-Received: (qmail 63775 invoked by uid 3782); 11 Mar 2016 18:24:26 -0000 Original-Received: from acm.muc.de (p579E8E6B.dip0.t-ipconnect.de [87.158.142.107]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 11 Mar 2016 19:24:25 +0100 Original-Received: (qmail 5341 invoked by uid 1000); 11 Mar 2016 18:27:06 -0000 Content-Disposition: inline In-Reply-To: <56E0805F.3050804@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:201479 Archived-At: Hello, Martin. On Wed, Mar 09, 2016 at 08:58:23PM +0100, martin rudalics wrote: > > ... and so far there's been no > > feedback from anybody else who's tried it. > With emacs -Q and non-optimized builds I've been profiling the following > two primitives > (defun foo () > (interactive) > (while (not (eobp)) > (c-end-of-defun))) > (defun bar () > (interactive) > (while (not (bobp)) > (c-beginning-of-defun))) > to scan the entire buffer of current master's xdisp.c. The results of > current master with or without your change are approximately the same > ‘foo’ taking about 73 seconds, ‘bar’ about 8 minutes, in both cases the > comment-cache version was slightly slower. Thanks for taking the trouble to try this. I get the following timings: without comment-cache with comment-cache foo 15.64s 7.89s bar 96.53s 89.93s So my results are the opposite from yours. In particular for `foo', the comment cache gave a dramatic speedup. > However, ‘foo’ is about ten times slower than for a version of Emacs > 24.2 which is about two times slower than for a version of Emacs 23.0. > ‘bar’ is about 5 times slower than the Emacs 24.2 version which is 3.5 > times slower than the one from Emacs 23.0. > So, for example, executing ‘bar’ for my Emacs 23.0 took 24.89 seconds > (0.068 for an average call) versus 464.375 seconds (1.272 average) with > the comment-cache version. This means that performance has deteriorated > by a factor of 18 over the past years. This also means that I cannot > use non-optimized builds for my daily work any more. Sorry. It seems this is a "popular" observation. I'm going to have to spend some time working out what can be taken out of CC Mode, and at what cost in correctness. I can't promise much progress quickly, but I promise to put work into it soon. > Maybe someone could try to test these two functions in a similar fashion > so we have at least some numbers to base judgements on. Sometimes it > seems to me that I'm living in a different world ... > Thanks, martin P.S. I've just run `bar' with elp enabled (all `c-..' functions plus `parse-partial-sexp' and `scan-lists' being instrumented), and I get the following: c-beginning-of-defun 365 97.659041618 0.2675590181 c-beginning-of-decl-1 1071 95.573583641 0.0892377064 c-syntactic-skip-backward 2239 91.440043437 0.0408396799 c-in-knr-argdecl 1071 90.988073058 0.0849561839 parse-partial-sexp 392328 86.160691713 0.0002196139 c-beginning-of-statement-1 1071 4.3989913499 0.0041073682 c-where-wrt-brace-construct 365 4.0776264500 0.0111715793 c-in-function-trailer-p 365 2.4348031740 0.0066706936 scan-sexps 12402 2.4236885029 0.0001954272 , so it seems fairly obvious now where the saving must come from. -- Alan Mackenzie (Nuremberg, Germany).