Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339634

Summary: [performance] Quick fix create local variable and others can be slow
Product: [Tools] CDT Reporter: Marc-André Laperle <malaperle>
Component: cdt-codanAssignee: Marc-André Laperle <malaperle>
Status: ASSIGNED --- QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Quick fix performance improvements malaperle: iplog-

Description Marc-André Laperle CLA 2011-03-10 23:19:57 EST
Create local variable, create field and create parameter can be slow especially when they need to infer the type inside a function call. Most of the time is spent building ASTs inside CxxASTUtils.tryInferTypeFromFunctionCall
Comment 1 Marc-André Laperle CLA 2011-03-11 00:12:31 EST
Created attachment 190954 [details]
Quick fix performance improvements

The ASTs are built with the flag AST_SKIP_INDEXED_HEADERS but a null index is passed. The ASTs can also be cached, at least locally, so that they are not rebuilt. 

I see this as an interim improvement until we have a class like RefactoringASTCache available to codan. This will probably be done part of bug 337486 but I will keep this bug opened until then to make sure quick fixes take advantage of this.
Comment 2 Marc-André Laperle CLA 2011-03-11 00:16:18 EST
Committed to HEAD.
Comment 3 CDT Genie CLA 2011-03-11 00:23:41 EST
*** cdt cvs genie on behalf of mlaperle ***
Bug 339634 - [performance] Quick fix create local variable and others can be slow

[*] CxxAstUtils.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java?root=Tools_Project&r1=1.11&r2=1.12