[Top][All Lists]

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

Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text

From: Alan Mackenzie
Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'.
Date: Mon, 14 Mar 2016 18:46:21 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Dmitry.

On Mon, Mar 14, 2016 at 07:52:27PM +0200, Dmitry Gutov wrote:
> On 03/14/2016 07:29 PM, Alan Mackenzie wrote:

> > CC Mode doesn't use syntax-ppss.  It would be too much work to put it in,
> > particularly as that function's future is unclear.

> Could you please avoid FUD like that?

There's no FUD in my last paragraph, it's an accurate representation of
the facts.  I am not prepared to spend the time needed to adapt CC Mode
to use syntax-ppss, and wouldn't be even if it worked properly.

> >> IIRC, Stefan posted a patch, which was like 10 lines long.

> > Sorry, patch for what?  I've lost the context.

> That one:

> http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg00593.html
> http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg00619.html

OK.  Stefan posted such a patch.  Now what was your point?

> Any other grunt work I can assist with?

I'm still trying to work out the point you're trying to make.

> >> Could you please try it already, so we can move on to discussing the
> >> actual performance problems of syntax-ppss, instead of theoretical ones?

> > It would be a lot of work.  Perhaps you might like to undertake it.

> Applying a patch and doing the measurements is a lot of work?

Ah, so by "it" in "please try it already" you meant "apply Stefan's
patch".  That wasn't clear.  Sorry.

Yes, applying that patch and doing measurements would be a lot of work.
You're welcome to do it if you're interested enough.

I have tried out Stefan's patch, and for the vast majority of
comments on which it actually works, I've no doubt it will work fast
enough.  Its speed isn't the issue.

Stefan's patch doesn't actually fix what I see as the root cause of bug
#22884, namely that comments get scanned backwards.  At some time in the
future this backward scanning will cause more bugs.

What has been tried is Martin Rudalics's `foo' and `bar' functions
(which repeatedly perform `c-end-of-defun' and `c-beginning-of-defun'
respectively).  I'm not the only person who has noticed a dramatic
increase in speed for the comment-cache branch in these
(unrepresentative) tests.  If you're interested, look at some of the
timings in the posts branching off of Martin's first post in this

[ .... ]

> >> How do these timings translate into whole seconds of waiting after
> >> pressing '/'?

> > They don't.  It was CC Mode's indentation engine's scanning, not the raw
> > parse-partial-sexp scanning.

> I guess we found the problem, then. And the cache's performance is 
> unlikely to change much.

It will make no difference to the scenario in #22884, no, and it was
never envisaged that it would.  What all these things have in common is
problems caused by scanning comments backwards.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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