From: Alan Mackenzie <acm@muc.de>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: Scrolling xdisp.c. Room for optimisation in syntax.c/CC Mode.
Date: Mon, 20 Oct 2014 11:47:27 +0000 [thread overview]
Message-ID: <20141020114727.GB2947@acm.acm> (raw)
In-Reply-To: <5444B9EF.4050506@gmx.at>
[-- Attachment #1: Type: text/plain, Size: 2604 bytes --]
Hi, Martin.
On Mon, Oct 20, 2014 at 09:29:51AM +0200, martin rudalics wrote:
> Results for Windows XP with CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3'
> --enable-checking=yes --enable-check-lisp-object-type=yes:
> Unmodified xdisp.c from trunk:
> 24.3 1007 scrolls, total time = 105.60900020599365s.
> 24.4 1007 scrolls, total time = 73.21900010108948s.
> 25.0 1007 scrolls, total time = 318.5629997253418s.
> xdisp.c from trunk with odd apostrophes eradicated:
> 24.3 1007 scrolls, total time = 100.1240005493164s.
> 24.4 1007 scrolls, total time = 60.13900017738342s.
> 25.0 1007 scrolls, total time = 197.95300006866455s.
> I can't test with older versions since those don't have
> `scroll-down-command' here.
Just replace it with `scroll-down'.
> So while it might be worthwhile to do such an optimization, here the
> great differenece is the 3-to-5-fold increase of execution time from
> 24.4 to 25.0 for which I don't have an explanation. The cc-mode used is
> always the one bundled with the respective Emacs version.
I got this, until I re-bootstrapped my trunk with full compiler
optimisation, no debugging set, and no extra checks enabled. Then I got
pretty much the same results for the trunk as 24.4.
The main reason I did all this, which nobody's commented on so far, was
to get a handle on how much the `open-paren-in-column-0-is-defun-start',
now bound to nil at critical places in CC Mode, was actually costing on a
large C file. On 24.4 you get 22%, on the trunk, 61%. I get 31% in
24.4, and 32% in the trunk.
It seems that "instrumentation" is increasing the cost of
open-paren-etc.
> martin
> BTW, if you want to quickly visualize constructs like
> (defconst odd-apostrophes
> "/\\*\\([^*']\\|\\*+[^*'/]\\)*\\(\\**'\\([^*']\\|\\*+[^*'/]\\)*\\**'\\([^*']\\|\\*+[^*'/]\\)*\\)*\\**\\('\\)\\([^*']\\|\\*+[^*'/]\\)*\\*+/"
> )
> without adding comments like
> ;; 1 2 3 4 5 6
> you can use the regexp-lock.el package I attached here ;-)
Neat!
What I actually use is a little tool I wrote called pp-regexp. Given a
string, it dumps a readable representation of the regexp into *scratch*,
something like:
/\*\( \| \)*\( \)*\**\( \)\( \| \)*\*+/
[^*'] \*+[^*'/] \**'\( \| \)*\**'\( \| \)* ' [^*'] \*+[^*'/]
[^*'] \*+[^*'/] [^*'] \*+[^*'/]
See attached file.
--
Alan Mackenzie (Nuremberg, Germany).
[-- Attachment #2: pp-regexp.el.gz --]
[-- Type: application/octet-stream, Size: 1105 bytes --]
next prev parent reply other threads:[~2014-10-20 11:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-18 18:19 Scrolling xdisp.c. Room for optimisation in syntax.c/CC Mode Alan Mackenzie
2014-10-18 20:28 ` Alan Mackenzie
2014-10-19 16:37 ` Ulrich Mueller
2014-10-19 17:49 ` Eli Zaretskii
2014-10-19 18:05 ` Ulrich Mueller
2014-10-20 1:41 ` Stefan Monnier
2014-10-20 7:24 ` Ulrich Mueller
2014-10-20 15:45 ` Stefan Monnier
2014-10-20 16:55 ` Ulrich Mueller
2014-10-20 7:29 ` martin rudalics
2014-10-20 11:47 ` Alan Mackenzie [this message]
2014-10-20 12:05 ` martin rudalics
2014-10-20 12:22 ` Óscar Fuentes
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=20141020114727.GB2947@acm.acm \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--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.