Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Performance with SearchEngine(Performance with SearchEngine. Provide any accessible classes, filtered by text typed.)
icon5.gif  Performance with SearchEngine [message #990603] Thu, 13 December 2012 11:55 Go to next message
Arthur Rocha is currently offline Arthur RochaFriend
Messages: 1
Registered: December 2012
Junior Member

I'm developing a plugin to create methods in my project.
I need provide all classes that can be accessible by a class that I'm editing.
I use the SearchEngine to find Classes to provide proposals, but if I define my research (scope) for "SOURCES | APPLICATION_LIBRARIES | REFERENCED_PROJECTS | SYSTEM_LIBRARIES" sometimes it's slowly or I get one "OutOfMemory". (Searching for CLASS_AND_INTERFACE | DECLARATIONS).
Researching how the eclipse is so fast in your researches I find that uses an "Index" (stored in '.metadata' of the 'workspace') and keep the results in memory.
I'm thinkin to keep the result of search "SYSTEM_LIBRARIES" (in the first request and exclude from the scope of research) in memory (static var in my plugin) and after that, filter this static list by the text typed, I'll do this in one class that extends TypeNameMatchRequestor. Any way, if my project has a lot of libraries my research still slow.
Is there a way to use "indexes" of the eclipse?
You know another solution for this case? (Provide any accessible classes, filtered by text typed, quickly and safely).
Sometime I saw that is not recommended to use static variables in the plugin, I'll take issue with this "solution"?

Re: Performance with SearchEngine [message #990910 is a reply to message #990603] Fri, 14 December 2012 19:24 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1598
Registered: July 2009
Senior Member
When searching via the SearchEngine, you are implicitly using the indexes already.
I could imagine that slowness comes from the second phase of searching where index matches are located precisely inside Java code.
You may want to step through, SearchParticipant[], IJavaSearchScope, SearchRequestor, IProgressMonitor) to see where the time is consumed.

Perhaps you'll find a faster solution by looking at how Open Type et al are doing the search, see org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.

Previous Topic:How to detect what is causing excessive Autobuild
Next Topic:eclipse crashes during startup with NullPointerException
Goto Forum:

Current Time: Tue Apr 24 21:20:06 GMT 2018

Powered by FUDForum. Page generated in 0.01789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software