Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Fastest? JavaProject.findType() or SearchEngine.findAllTypeNames(TypeNameMatchRequestor) or SearchEn
Fastest? JavaProject.findType() or SearchEngine.findAllTypeNames(TypeNameMatchRequestor) or SearchEn [message #257203] Tue, 04 November 2008 10:31 Go to next message
Eclipse UserFriend
As far as I can tell, there are many ways to find an IType that maps to
a simple (non-nested/secondary) Java type. I am looking for the fastest
way to get an IType. Most of these also take a progress monitor (which I
like) except for JavaProject.findType().

What are the different performance characteristics of this method? What
kind of caches are involved? Are searches cached? Will calling findType
on the same project multiple times be faster than searching on the same
project multiple times?

Thanks,

Min Idzelis
Re: Fastest? JavaProject.findType() or SearchEngine.findAllTypeNames(TypeNameMatchRequestor) or Sear [message #257364 is a reply to message #257203] Thu, 13 November 2008 10:54 Go to previous message
Eclipse UserFriend
Min Idzelis wrote:
> As far as I can tell, there are many ways to find an IType that maps to
> a simple (non-nested/secondary) Java type. I am looking for the fastest
> way to get an IType. Most of these also take a progress monitor (which I
> like) except for JavaProject.findType().
There are 2 versions of IJavaProject.findType(). One that doesn't take a
progress monitor but that doesn't find secondary types. The other one
that takes a progress monitor and that finds secondary types.

> What are the different performance characteristics of this method? What
> kind of caches are involved? Are searches cached? Will calling findType
> on the same project multiple times be faster than searching on the same
> project multiple times?
SearchEngine.search() and SearchEngine.findAllTypeNames() will both use
already computed indexes. They are designed to be very fast across
projects.
IJavaProject.findType() will use the Java model cache which is an LRU
cache. This cache is lazily computed. So the first request might be
slower than subsequent requests.

If you already have an IJavaProject in hand, I would advise to use
IJavaProject.findType(String, IProgressMonitor).

Jerome
Previous Topic:Code templates in conditional breakpoints
Next Topic:Java package sort order
Goto Forum:
  


Current Time: Wed Apr 23 12:03:10 EDT 2025

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

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

Back to the top