DESCRIPTION

[IndexDiffCacheEntry] Introduce IndexDiffUpdateJob to schedule resource
updates

The IndexDiffCacheEntry currently immediately schedules update jobs on
resource changes. Given a resource related task which affects multiple
resources in 'n' workspace changes (e.g. "clean compile" on n projects),
IndexDiffCacheEntry.scheduleUpdateJob() is called n times on same
repository, creating n jobs (which in worst case creates n threads in
Eclipse), running one after each other and creating n notifications on
completion. This significantly affects Eclipse UI performance on huge
git repositories.

To avoid this, one single (collecting resources) IndexDiffUpdateJob is
created and used per IndexDiffCacheEntry. On each resource change
pending changes are collected by this job, but instead of immediate
scheduling default delay of 400 milliseconds is used to schedule the
job. This reduces both memory consumption and overhead by reducing
notifications count to UI listeners.

Bug: 417597
Change-Id: I0922cf83623bd15fee80569b31986990028e7c9d
Signed-off-by: Jayvion Booth xxx@xxx.xxx

COMMENTS

author: Jayvion Booth
date: 2014-07-22 15:17:10.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-07-22 15:32:27.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-07-22 15:54:22.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/6077/ : SUCCESS

-------------------------------------
author: Danika Greer
date: 2014-07-23 13:06:51.000000000

Patch Set 1:

(6 comments)

+1 on the general change! Some small suggestions.

Line:21, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Could you mention that the same job instance is used repeatedly here?

Line:23, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Remove public, doesn't need to be public.

Line:31, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Could you convert these to Sets? Makes it clearer to me.

Line:69, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Small style nit: We don't use braces around simple statements.

Line:90, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Small style nit: We don't use braces around simple statements.

Line:8, /COMMIT_MSG -> Please make this fit on one line. You can remove the "[IndexDiffCacheEntry] ".

-------------------------------------
author: Jayvion Booth
date: 2014-07-24 07:22:33.000000000

Patch Set 1:

(6 comments)

Line:21, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Done

Line:23, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Done

Line:31, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Done

Line:69, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Done.

Offtopic: this is so far the most surprising/annoying style rule I've met in Eclipse code. 

In production I've seen multiple times such code which was differently *read* as written due the wrong indentation after merge etc and each time people spent lot of time debugging such crazy places and literally *not seeing* the broken logic. All this because of ... two missing braces. 

Anyway, it's project choice, but do we have any chance to convince people to change this style rule?

Line:90, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Done

Line:8, /COMMIT_MSG -> Done

-------------------------------------
author: Danika Greer
date: 2014-07-24 10:28:34.000000000

Patch Set 1:

(1 comment)

Line:69, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffUpdateJob.java -> Yes, I also dislike this "rule". The worst part about it is that it can't be configured in format-on-save (because the rule is: only do it for "simple" statements). Also, it's always an issue for new contributors.

So I'm +1 for always adding braces in new code, but others might disagree.

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