DESCRIPTION

[sync] Improve performance

Adds thin cache that contains meta data (like changed object id's and
change type) from git. This cache is filled in background process just
before synchronization is launched and then it is used for quick
obtaining list of members for particular folder.

During my tests this implementation reduce time needed to compare linux
kernel source (version 2.6.38-rc2 against 2.6.36) in less then 1min
(usually 55s), when implementation from 1.0 needs 1m 40s.

Additionally some tests were updated.

This change requires also jgit change
I5a680a73e1cffa18ade3402cc86008f46c1da1f1

Change-Id: I7ddb21e7ff54333dd6d7ace3209bbcf83da2b219
Signed-off-by: Leslie Stephenson xxx@xxx.xxx

COMMENTS

author: Leslie Stephenson
date: 2011-08-19 15:47:37.000000000

Uploaded patch set 11.

-------------------------------------
author: Brenden Conley
date: 2011-08-19 15:47:41.000000000

Patch Set 11:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/1497/ 

-------------------------------------
author: Brenden Conley
date: 2011-08-19 15:58:59.000000000

Patch Set 11: Build Successful

Build Successful 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/1497/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2011-08-20 22:18:48.000000000

Patch Set 11: I would prefer that you didn't submit this

- tests are succeeding now :-)

- when synchronizing a commit with its immediate predecessor in the history the synchronize view shows the differing files as conflicting, this seems wrong

- I hit the following exceptions:

eclipse.buildId=I20110603-0909
java.version=1.6.0_26
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data /Users/d029788/Documents/workspace/egit/../runtime-EGit(Indigo) -dev file:/Users/d029788/Documents/workspace/egit/.metadata/.plugins/org.eclipse.pde.core/EGit/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog

Error
Sun Aug 21 00:04:14 CEST 2011
There is no cached contents for resource org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java.

org.eclipse.team.core.TeamException: There is no cached contents for resource org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java.
	at org.eclipse.team.core.variants.CachedResourceVariant$ResourceVariantStorage.getContents(CachedResourceVariant.java:63)
	at org.eclipse.egit.core.synchronize.GitResourceVariantComparator.compare(GitResourceVariantComparator.java:54)
	at org.eclipse.team.core.synchronize.SyncInfo.calculateKind(SyncInfo.java:432)
	at org.eclipse.team.core.synchronize.SyncInfo.init(SyncInfo.java:401)
	at org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber.getSyncInfo(GitResourceVariantTreeSubscriber.java:200)
	at org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.getSyncInfo(ResourceVariantTreeSubscriber.java:59)
	at org.eclipse.team.core.subscribers.Subscriber.getDiff(Subscriber.java:371)
	at org.eclipse.team.internal.core.subscribers.SubscriberDiffTreeEventHandler.handleChange(SubscriberDiffTreeEventHandler.java:162)
	at org.eclipse.team.internal.core.subscribers.SubscriberEventHandler.collect(SubscriberEventHandler.java:219)
	at org.eclipse.team.internal.core.subscribers.SubscriberEventHandler.processEvent(SubscriberEventHandler.java:310)
	at org.eclipse.team.internal.core.BackgroundEventHandler.processEvents(BackgroundEventHandler.java:369)
	at org.eclipse.team.internal.core.BackgroundEventHandler$1.run(BackgroundEventHandler.java:203)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

eclipse.buildId=I20110603-0909
java.version=1.6.0_26
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data /Users/d029788/Documents/workspace/egit/../runtime-EGit(Indigo) -dev file:/Users/d029788/Documents/workspace/egit/.metadata/.plugins/org.eclipse.pde.core/EGit/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog

Error
Sun Aug 21 00:12:59 CEST 2011
An internal error occurred processing subscriber events.

org.eclipse.team.core.TeamException: An internal error occurred processing subscriber events.
	at org.eclipse.team.internal.core.subscribers.SubscriberEventHandler.processEvent(SubscriberEventHandler.java:332)
	at org.eclipse.team.internal.core.BackgroundEventHandler.processEvents(BackgroundEventHandler.java:369)
	at org.eclipse.team.internal.core.BackgroundEventHandler$1.run(BackgroundEventHandler.java:203)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.NullPointerException
	at org.eclipse.egit.core.synchronize.GitSyncObjectCache.get(GitSyncObjectCache.java:135)
	at org.eclipse.egit.core.synchronize.GitResourceVariantTree.fetchVariant(GitResourceVariantTree.java:101)
	at org.eclipse.egit.core.synchronize.GitResourceVariantTree.fetchVariant(GitResourceVariantTree.java:80)
	at org.eclipse.egit.core.synchronize.GitResourceVariantTree.getResourceVariant(GitResourceVariantTree.java:147)
	at org.eclipse.team.core.variants.ResourceVariantTreeSubscriber.getSyncInfo(ResourceVariantTreeSubscriber.java:52)
	at org.eclipse.team.core.subscribers.Subscriber.getDiff(Subscriber.java:371)
	at org.eclipse.team.internal.core.subscribers.SubscriberDiffTreeEventHandler.handleChange(SubscriberDiffTreeEventHandler.java:162)
	at org.eclipse.team.internal.core.subscribers.SubscriberEventHandler.collect(SubscriberEventHandler.java:219)
	at org.eclipse.team.internal.core.subscribers.SubscriberEventHandler.processEvent(SubscriberEventHandler.java:310)
	... 3 more

-------------------------------------
author: Leslie Stephenson
date: 2011-08-20 22:56:23.000000000

Patch Set 11:

* Regardless conflicting changes, this is true since currently synchronize cache is using two-way-diff and it cannot calculate proper direction base on those data. In change #3891 this issue is fixed. Can we assume that this change is only transition between 1.0 and change #3891 ?
* This is also true, since we are still reusing standard SyncInfo implementation from Team Framework and it is also fixed in change #3891. Same as before I would suggest to treat this chance as a transitional.

-------------------------------------
author: Douglas Trujillo
date: 2011-08-29 11:43:41.000000000

Patch Set 11:

Could you rebase this change onto current master and 3891 on top of this ? I tried but I struggle to resolve some nasty conflicts.

-------------------------------------
