unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Re: Scrolling xdisp.c.  Room for optimisation in syntax.c/CC Mode.
Date: Sat, 18 Oct 2014 20:28:39 +0000	[thread overview]
Message-ID: <20141018202839.GB5924@acm.acm> (raw)
In-Reply-To: <20141018181937.GA5924@acm.acm>

On Sat, Oct 18, 2014 at 06:19:38PM +0000, Alan Mackenzie wrote:
> Hi, Emacs.

> I've measured the time Emacs takes to scroll a large C file, and how much
> of this is due to the inefficiency in backwards `scan-lists's when
> comments contain unbalanced string characters (with
> open-paren-in-column-0-is-defun-start nil).

[ ... ]

> On my set up, a Linux virtual terminal with a window 65 lines high, I get
> the following results:
>     no-odd-xdisp.c: 492 scrolls, total time = 42.2749125957489s
>            xdisp.c: 492 scrolls, total time = 69.40998315811157s.

> 69.4100 / 42.2749 = 1.642.  The original thus takes 64% longer (on
> average) for a backward scroll operation.

I forgot to mention that this was on Emacs 24.3, with full .emacs loaded,
and with an up-to-date stand-alone CC Mode.

> It would seem worthwhile to consider optimising the code to eliminate
> this 64%.  Two possibilities suggest themselves: (i) in syntax.c, by
> making use of the syntax-ppss cache (or similar); (ii) In CC Mode, by
> setting syntax-table text properties on unbalanced string quotes.

I've just repeated the measurement on the Emacs trunk, with emacs -Q.  I
now get these results:
    no-odd-xdisp.c: 500 scrolls, total time = 104.21487808227539s.
           xdisp.c: 500 scrolls, total time = 167.73530864715576s.

I don't know why there are more scroll operations needed.  But the fact
that scrolling is taking two and a half times longer in the trunk than in
24..3 is noteworthy, and possibly disturbing.  I'm think I compiled both
version with the same optimisation level, etc.
    
> -- 
> Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2014-10-18 20:28 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141018202839.GB5924@acm.acm \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).