Bug 464603 - [content assist] Consider computing AnonymousTypeCompletionProposal label lazily
Summary: [content assist] Consider computing AnonymousTypeCompletionProposal label lazily
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 09:33 EDT by Marcel Bruch CLA
Modified: 2015-04-14 11:01 EDT (History)
1 user (show)

See Also:


Attachments
Profiling Screenshot (483.08 KB, image/png)
2015-04-14 09:33 EDT, Marcel Bruch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Bruch CLA 2015-04-14 09:33:40 EDT
Created attachment 252381 [details]
Profiling Screenshot

Profiling shows that after fixing bug 464552 the next bottleneck in creation of AnonymousTypeCompletions [1] are:

1. IJavaElement element= fJavaProject.findElement(new String(declarationKey), null) and
2. StyledString label= fLabelProvider.createAnonymousTypeLabel(proposal);


While 1. seems to be necessary on a first look (assuming that there really may be a case where the element may be null), 2. looks like a candidate for lazy initialization of the styled display string.

If changing this, using LazyJavaCompletionProposal (or a subtype of it) as superclass looks more appropriate to me.



However, the performance gain by bug 464552 is more significant. AFAICT ATM this change would be a noticeable but smaller enhancement.



[1] org.eclipse.jdt.ui.text.java.CompletionProposalCollector.createAnonymousTypeProposal(CompletionProposal, JavaContentAssistInvocationContext)