[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CC Mode now respects users' settings of open-paren-in-column-0-is-de

From: Alan Mackenzie
Subject: Re: CC Mode now respects users' settings of open-paren-in-column-0-is-defun-start.
Date: Sun, 15 Nov 2015 22:14:44 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, Martin.

On Thu, Nov 12, 2015 at 06:09:39PM +0000, Alan Mackenzie wrote:

> > So far, the performance didn't improve significantly.  Either there are
> > other changes that did make editing C deteriorate considerably over the
> > past two years or I still have to tweak some internal settings.  I'll
> > get back to you as soon as I know more.

> I noticed a large degradation in speed, too.  I timed the complete
> fontification of xdisp.c, and Emacs 24.5 was taking ~40s (with
> o-p-i-c-0-i-defun-start t).  The same on Emacs 25.1 is taking ~77s.  The
> difference seems to be between standalone CC Mode and the version
> included with Emacs 25.1.  There's some bug on savannah CC Mode which
> hasn't been fixed, or some optimisation which hasn't been made.

> (Somewhat later).  The standalone CC Mode doesn't (in the default
> branch) contain certain C++11 enhancements.  These seem to be what is
> slowing things down.  This should be easily fixable for C Mode, but it
> would be nice to fix it for C++ Mode, too.

I've just committed a fix (to the emacs-25 branch), mainly for C++ Mode,
but also for C Mode, too.

When I time the scrolling through xdisp.c, with the fix it now takes
~42s.  Without the fix, it's around 77s.  Here's the program I used to
time with (you need to initialise C Mode each time you rerun the test,
of course, to reinitialise Font Lock Mode):

  (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)))
      (- (float-time) start)))

  (defun time-scroll ()
    (message "%s"
              (condition-case nil
                  (while t
                    (sit-for 0))
                (error nil)))))

> > martin

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]