emacs-devel
[Top][All Lists]
Advanced

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

Re: Reliable after-change-functions (via: Using incremental parsing in E


From: Dmitry Gutov
Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs)
Date: Thu, 2 Apr 2020 19:17:07 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 02.04.2020 17:23, Eli Zaretskii wrote:

Comparing both, looks like redisplay (when at eob, at least) takes
approx. the same amount of time?

About 55% taken by redisplay (almost all of it due to fontification),
and the other 45% are the C mode "preprocessing" when the mode is
turned on in a buffer.

So, all in all, when xdisp.c is opened at eob, it will be displayed after ~2.5 seconds, I guess.

So you are saying that we should do that up-front computation just
because CC mode currently does it?  That we shouldn't try to eliminate
such preprocessing?  I don't think so.

AFAIU CC Mode could actually eliminate it, but that would require a
significant rework of its internals.

Are we still talking about integrating a completely different parsing
engine into CC Mode?  Then redesign is a must, right?

No, that's without TreeSitter.

I'm just pointing out that apparently you didn't even notice an even
larger delay (1.7s), and were fine with it until now.

I didn't "didn't notice", I actually filed several bug reports and
complaints about the various slow aspects of CC mode, because the
slowdown in CC mode over the years annoys me quite a lot.  Some of the
problems were fixed, some weren't (due to limitations of the current
design, I was told).  I'm not at all complacent about this.

Still, compare that with 0.15 sec, which is the current estimate of parsing xdisp.c. It could probably be improved still by supporting a no-copy buffer-string in modules.

I cannot tell the volunteers what to do and where to invest their
resources.  But I can provide feedback on the design ideas, based on
what I know and on my experience, and I can suggest how to design and
implement this to achieve good and scalable performance.

We shouldn't, however, create an impression that unless they follow our ideas to a T we won't help them realize their own preferred approach (e.g. by improving the module API).

> In
> particular, I think that it is useful to know what we have tried in
> the past and what were the lessons we learned from that.  I hope what
> I say is of some help, and I hope we will soon have such engine
> available to Emacs.

I'm fairly confident that implementing deferred/on-demand parsing in emacs-tree-sitter can be done later without requiring a major redesign. It will require, however, an extra layer of complexity either way.



reply via email to

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