Bug 515668 - Use more efficient APIs to read projects during refresh

Instead of iterating on projects to invoke N times
readMavenProjectFacades (L399) and each of this time creating depth(N)
MavenProjects (1 for each stage of the parent hierarchy), we accumulate
the projects to update and call readManageProjectFacades only once that
shares hierarchy of objects, resulting in O(N) MavenProject instances.
As a result, we replace "sum of all depths of all projects" instances by
"amount of project" instances, which in most case can be a 2 or 3
factor, and for biggest projects can be a 6 or 7 factor.

The further steps of the refresh operation are not optimized at the
moment, as they're not involved in the usual import step. But they would
be worth a further improvement.

Change-Id: Icf38520d1c220590612dd32f4481eb703827e747
Signed-off-by: Mickael Istria <mistria@redhat.com>
9 files changed