emacs-devel
[Top][All Lists]
Advanced

[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: Dmitry Gutov
Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'.
Date: Mon, 14 Mar 2016 21:33:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

Hi Alan,

On 03/14/2016 08:46 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.

Not at all. syntax-ppss's future is rather clear, and it's here to stay, after years of successfully being in use.

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.

That's a separate issue. Right now we're discussing how to best implement "comment cache", and if it's needed at all.

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

Apparently, the point is that you've been offered a simpler solution for the same problem, and that you basically ignored it.

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

Isn't what this subthread is about? The alternative approach?

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 might, but you'd first have to let me know what to test. If the comment cache patch doesn't actually help with 22884, why are we even discussing it?

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.

Ah, so the speed advantage of using text properties is not that much of advantage. Correct?

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.

Can you produce a test case where it fails? This time without involving narrowing, please.

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
thread.

Do you have any non-synthetic tests? (while (not (eobp)) (end-of-defun)) is not something that is likely to occur is a user's interation with Emacs with any regularity.

For a synthetic test, by the way, a 60%-80% increase in performance is not that impressive.

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.

syntax-ppss helps with avoiding that.



reply via email to

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