More optimizations, see summary in 1GHFO1M
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
index 9eec095..1d71f22 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
@@ -338,20 +338,7 @@
  * the phantom boolean is true.

  */

 public int countResources(int depth, boolean phantom) throws CoreException {

-	ResourceInfo info = getResourceInfo(phantom, false);

-	if (!exists(getFlags(info), false))

-		return 0;

-	int total = 1;

-	if (getType() == FILE || depth == DEPTH_ZERO)

-		return total;

-	if (depth == DEPTH_ONE)

-		depth = DEPTH_ZERO;

-	IResource[] children = ((Container) this).members(phantom);

-	for (int i = 0; i < children.length; i++) {

-		Resource child = (Resource) children[i];

-		total += child.countResources(depth, phantom);

-	}

-	return total;

+	return workspace.countResources(path, depth, phantom);

 }

 /**

  * @see IResource