Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » newTypeHierarchy really slow
newTypeHierarchy really slow [message #335014] Mon, 16 March 2009 17:03
Eclipse UserFriend
Originally posted by: talon.karrde.sw.gmail.com

Hi,

I'm currently working on a plugin that requires to perform a search for
types on the whole workspace using
org.eclipse.jdt.core.IJavaProject.newTypeHierarchy which is very slow
(nearly 20 sec in my case). Here is a sample code:

IRegion region = JavaCore.newRegion();
IProject[] projects =
ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject proj : projects)
{
IJavaProject jproj = JavaCore.create(proj);
for (IJavaElement i : jproj.getPackageFragmentRoots())
{
if (i.getElementName().equals("generated"))
{
region.add(i);
}
}
}
region.add(jproject);
ITypeHierarchy typeHyerarchy = jproject.newTypeHierarchy(port, region,
null);

I have several questions:

1-Is there anyway to optimise this code?
2-If there's not, I want to execute this code at eclipse startup, I'm
wondering if IStartup.earlyStartup executes after projects inside the
workspace are loaded or not.

Thanks,

Fran
Previous Topic:[Databinding] JFace Databinding for DOM-SSE
Next Topic:Update fails "No repository found containing..."
Goto Forum:
  


Current Time: Thu Apr 25 06:44:06 GMT 2024

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

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

Back to the top