From: Alan Mackenzie <acm@muc.de>
To: martin rudalics <rudalics@gmx.at>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
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 [thread overview]
Message-ID: <20160311182706.GE2888@acm.fritz.box> (raw)
In-Reply-To: <56E0805F.3050804@gmx.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).
next prev parent reply other threads:[~2016-03-11 18:27 UTC|newest]
Thread overview: 130+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160308132530.861.91488@vcs.savannah.gnu.org>
[not found] ` <E1adHdj-0000FI-0W@vcs.savannah.gnu.org>
2016-03-08 14:19 ` [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment' Stefan Monnier
2016-03-08 18:30 ` Alan Mackenzie
2016-03-08 18:42 ` Stefan Monnier
2016-03-08 20:07 ` Alan Mackenzie
2016-03-08 21:22 ` Dmitry Gutov
2016-03-08 21:43 ` Alan Mackenzie
2016-03-09 0:17 ` Stefan Monnier
2016-03-09 1:54 ` Stefan Monnier
2016-03-09 10:49 ` Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.] Alan Mackenzie
2016-03-09 13:11 ` Stefan Monnier
2016-03-09 14:19 ` Alan Mackenzie
2016-03-09 19:16 ` Stefan Monnier
2016-03-09 19:22 ` Clément Pit--Claudel
2016-03-09 19:37 ` Alan Mackenzie
2016-03-09 21:40 ` Stefan Monnier
2016-03-10 13:01 ` Alan Mackenzie
2016-03-10 14:52 ` Stefan Monnier
2016-03-10 15:29 ` Alan Mackenzie
2016-03-10 16:45 ` Stefan Monnier
2016-03-10 17:25 ` Alan Mackenzie
2016-03-10 17:34 ` Stefan Monnier
2016-03-10 19:08 ` Alan Mackenzie
2016-03-10 23:10 ` Stefan Monnier
2016-03-11 12:50 ` Stefan Monnier
2016-03-11 20:48 ` Alan Mackenzie
2016-03-11 22:35 ` Stefan Monnier
2016-03-11 23:08 ` Alan Mackenzie
2016-03-11 23:09 ` Clément Pit--Claudel
2016-03-11 23:31 ` Stefan Monnier
2016-03-10 23:31 ` John Wiegley
2016-03-11 2:08 ` Clément Pit--Claudel
2016-03-11 3:08 ` Stefan Monnier
2016-03-11 7:27 ` Andreas Röhler
2016-03-11 12:08 ` Alan Mackenzie
2016-03-11 12:30 ` Dmitry Gutov
2016-03-11 13:04 ` Alan Mackenzie
2016-03-11 20:21 ` Dmitry Gutov
2016-03-12 20:19 ` Andreas Röhler
2016-03-12 20:38 ` Dmitry Gutov
2016-03-12 20:45 ` Alan Mackenzie
2016-03-13 14:56 ` Andreas Röhler
2016-03-10 13:41 ` Stefan Monnier
2016-03-09 17:06 ` How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]) Clément Pit--Claudel
2016-03-09 17:24 ` Kaushal Modi
2016-03-09 17:56 ` Clément Pit--Claudel
2016-03-09 19:19 ` Kaushal Modi
2016-03-09 19:34 ` Clément Pit--Claudel
2016-03-10 14:28 ` Stefan Monnier
2016-03-10 15:03 ` Clément Pit--Claudel
2016-03-10 15:20 ` Stefan Monnier
2016-03-10 17:21 ` Clément Pit--Claudel
2016-03-12 20:45 ` Andreas Röhler
2016-03-12 20:53 ` Clément Pit--Claudel
2016-03-09 16:37 ` [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment' Richard Stallman
2016-03-09 17:06 ` Dmitry Gutov
2016-03-10 21:20 ` Richard Stallman
2016-03-11 0:26 ` Dmitry Gutov
2016-03-11 12:22 ` Alan Mackenzie
2016-03-11 12:52 ` Stefan Monnier
2016-03-11 16:20 ` Drew Adams
2016-03-09 17:48 ` Alan Mackenzie
2016-03-09 19:58 ` martin rudalics
2016-03-09 20:36 ` Eli Zaretskii
2016-03-09 20:53 ` John Wiegley
2016-03-13 9:30 ` Daniel Colascione
2016-03-13 15:28 ` Stefan Monnier
2016-03-13 16:24 ` Eli Zaretskii
2016-03-13 16:27 ` Daniel Colascione
2016-03-13 17:19 ` Eli Zaretskii
2016-03-14 1:13 ` Stefan Monnier
2016-03-14 16:10 ` Eli Zaretskii
2016-03-11 18:27 ` Alan Mackenzie [this message]
2016-03-12 17:08 ` Alan Mackenzie
2016-03-12 18:10 ` martin rudalics
2016-03-12 18:22 ` Paul Eggert
2016-03-12 18:46 ` martin rudalics
2016-03-12 19:36 ` Alan Mackenzie
2016-03-13 9:26 ` martin rudalics
2016-03-13 11:52 ` Alan Mackenzie
2016-03-13 12:08 ` martin rudalics
2016-03-13 12:49 ` Alan Mackenzie
2016-03-13 13:32 ` martin rudalics
2016-03-13 17:59 ` Eli Zaretskii
2016-03-13 20:09 ` martin rudalics
2016-03-14 1:15 ` Paul Eggert
2016-03-14 7:42 ` martin rudalics
2016-03-14 11:22 ` Alan Mackenzie
2016-03-14 19:41 ` martin rudalics
2016-03-14 20:58 ` Alan Mackenzie
2016-03-14 16:15 ` Eli Zaretskii
2016-03-14 19:41 ` martin rudalics
2016-03-14 17:00 ` Paul Eggert
2016-03-14 19:41 ` martin rudalics
2016-03-14 16:09 ` Eli Zaretskii
2016-03-13 18:00 ` Eli Zaretskii
2016-03-13 18:41 ` Alan Mackenzie
2016-03-12 20:56 ` Dmitry Gutov
2016-03-12 21:29 ` Clément Pit--Claudel
2016-03-12 21:59 ` Dmitry Gutov
2016-03-12 21:58 ` Alan Mackenzie
2016-03-12 22:16 ` Dmitry Gutov
2016-03-13 17:59 ` Alan Mackenzie
2016-03-13 22:49 ` Stefan Monnier
2016-03-14 12:51 ` Alan Mackenzie
2016-03-15 3:14 ` Stefan Monnier
2016-03-14 1:13 ` Dmitry Gutov
2016-03-14 1:30 ` Stefan Monnier
2016-03-14 1:45 ` Dmitry Gutov
2016-03-14 2:18 ` Stefan Monnier
2016-03-14 12:23 ` Alan Mackenzie
2016-03-14 16:15 ` Dmitry Gutov
2016-03-14 17:29 ` Alan Mackenzie
2016-03-14 17:52 ` Dmitry Gutov
2016-03-14 18:46 ` Alan Mackenzie
2016-03-14 19:33 ` Dmitry Gutov
2016-03-14 21:20 ` Alan Mackenzie
2016-03-15 3:10 ` Stefan Monnier
2016-03-17 0:47 ` Dmitry Gutov
2016-03-17 18:47 ` Alan Mackenzie
2016-03-18 1:24 ` Dmitry Gutov
2016-03-10 21:20 ` Richard Stallman
2016-03-10 22:24 ` Alan Mackenzie
2016-03-12 1:53 ` Richard Stallman
2016-03-12 3:28 ` Stefan Monnier
2016-03-12 19:28 ` Richard Stallman
2016-03-09 17:51 ` Clément Pit--Claudel
2016-03-10 21:20 ` Richard Stallman
2016-03-10 21:38 ` Clément Pit--Claudel
2016-03-12 1:53 ` Richard Stallman
2016-03-10 7:14 ` Andreas Röhler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160311182706.GE2888@acm.fritz.box \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.