Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsPerformance with SearchEngine
https://www.eclipse.org/forums/index.php/mv/msg/441493/990603/#msg_990603
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"?
Thanks.]]>Arthur Rocha2012-12-13T11:55:43-00:00Re: Performance with SearchEngine
https://www.eclipse.org/forums/index.php/mv/msg/441493/990910/#msg_990910
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 org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(SearchPattern, 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.
HTH,
Stephan
]]>Stephan Herrmann2012-12-14T19:24:29-00:00