Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] completion performance


I've given some thought on how incremental parse can work.
When one edits a working copy, we can use the change bars to determine what portion of the parse tree is dirty or not.  
Content Assist (or the selection features as well) hold onto the AST between parses and we use the clean-up-until-offset to determine how to prune the tree and where to restart.  
Of course, we would have to add in a bunch of eventing to make sure that we would be getting up to date working copies and/or saved files as time went on.  

That being said, the largest problem with having a feature hang onto an AST is that the footprint is quite substantial.  The only thing we have been able to cache up to this point are the decoded file buffers as CodeReaders.  The syntactic AST has fine granularity, which means that to some extent, the number of nodes in the tree are preportional to the number of tokens in the translation unit.  Sharing AST-fragments between parses (i.e. the physical AST for windows.h) is difficult since the content of a file depends upon the IScannerInfo (which may change, w/per file options or discovery) or even the order of include directives.  

Comments?

JohnC
www.eclipse.org/cdt


cdt-dev-bounces@xxxxxxxxxxx wrote on 07/04/2005 07:59:19 PM:

> On 05/07/05, Doug Schaefer <dschaefer@xxxxxxxxxx> wrote:

> Yes, Rob, you are right on the money. We've called this "incremental
> parse" and is on the CDT's long term feature wish list. Hopefully we can
> find someone willing to put the work in to make it happen.

>
> Maybe I'll find time to take it on. It would certainly help
> enormously with my project. Can you give me any additional
> tips/comments on the approach I mentioned? Especially if there are
> any issues I haven't noticed ... I've only been looking at the code
> for a couple of days.
>
> Rob

> --
> ["Therefore, my dear friends, as you have always obeyed–not only in my
> presence, but now much more in my absence–continue to work out your
> salvation with fear and trembling, for it is God who works in you to will
> and to act according to his good purpose." Philippians 2:12-13.]
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top