Fix IteratorService performance on big repositories/workspaces
commitd3a78e05381ff38370ba6a6a1d6733d741d15f45
authorAndrey Loskutov <loskutov@gmx.de>
Wed, 30 Jul 2014 09:15:09 +0000 (30 11:15 +0200)
committerRobin Stocker <robin@nibor.org>
Wed, 30 Jul 2014 15:11:14 +0000 (30 11:11 -0400)
treea1b0b81b7cc1b5e27830753e8efed7408667a685
parent78ffbaae3b93a306c0e2eb485dcfac91f132f599
Fix IteratorService performance on big repositories/workspaces

IWorkspaceRoot.findContainersForLocationURI(URI) method performs very
poor on big repositories and workspaces, and gets even worse with lot of
links in the workspace too.

The fix tries first to get the direct workspace resources map hit by
using IWorkspaceRoot.getContainerForLocation(IPath) and only if this
fails, fail over to the slow findContainersForLocationURI method.

This works very fast for almost all cases (constant execution time) and
adds only a small overhead if the matching project/folder is contained
in a *closed* project which overlaps location of another *opened*
project.

Bug: 440722
Change-Id: Ia6eda95f082111355cf96209db588664c59476b6
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
org.eclipse.egit.core/src/org/eclipse/egit/core/IteratorService.java