[jbosstools-dev] Help needed on Eclipse Search performance

Max Rydahl Andersen max.andersen at redhat.com
Thu Jul 26 11:25:34 EDT 2012


Alexey, didn't you guys face the same issue with JSF/Seam/CDI class lookups in the "old" days that using the eclipse search is much slower than other lower-level mechanisms ?

/max

On 24 Jul 2012, at 12:19, Xavier Coulon wrote:

> Hello,
> 
> Pete Muir opened an issue a few weeks ago (https://issues.jboss.org/browse/JBIDE-12224) because he found that the JAX-RS tooling was sometimes taking too much time to build. He also attached a video to show what's happening on his machine: http://screencast.com/t/pHBqxVas4
> 
> Now, at the tooling level, here's what's happening: a set of jars are added to the classpath, and as part of the project build, the JAX-RS builder searches for some JAX-RS annotated types or methods in those new jars, using the Search API. Hélas, Eclipse needs to index those jars, which sometimes takes a few seconds.
> Now, as opposed to the CDI specification where the jars should have a marker file (META-INF/beans.xml), JAX-RS does not mandate anything similar, which means that the search includes all the jars..
> 
> Here's an example of the code that deals with annotated types search (in ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JaxrsAnnotationsScanner.java) :
> 
> 	private static List<IType> searchForAnnotatedTypes(final Class<?> annotation, final IJavaSearchScope searchScope,
> 			final IProgressMonitor progressMonitor) throws CoreException {
> 		JavaMemberSearchResultCollector collector = new JavaMemberSearchResultCollector(IJavaElement.TYPE, searchScope);
> 		SearchPattern pattern = SearchPattern.createPattern(annotation.getName(), IJavaSearchConstants.ANNOTATION_TYPE,
> 				IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE | IJavaSearchConstants.TYPE, SearchPattern.R_EXACT_MATCH
> 						| SearchPattern.R_CASE_SENSITIVE);
> 		// perform search, results are added/filtered by the custom
> 		// searchRequestor defined above
> 		new SearchEngine().search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
> 				searchScope, collector, progressMonitor);
> 		return collector.getResult(IType.class);
> 	}
> 
> 
> Do you know any way to reduce the latency at this level ? Is there any trick to improve the speed ?
>  
> Thanks in advance
> Best regards,
> /Xavier
> 
> 
> 
> _______________________________________________
> jbosstools-dev mailing list
> jbosstools-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-dev




More information about the jbosstools-dev mailing list