DESCRIPTION

[stagingView] Store children for tree nodes instead of scanning

Before, every time getChildren was called (for each node), all files and
folders were scanned to find the children. The more tree nodes there
are, the more this hurts, as the complexity is quadratic.

Bug: 420825
Change-Id: I16beb6c8caae17b53c4e3ad1f5ddb672f9e96a59
Signed-off-by: Danika Greer xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2013-11-23 18:30:30.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-11-23 18:43:28.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/5362/ : UNSTABLE

-------------------------------------
author: Brenden Conley
date: 2013-11-26 08:29:35.000000000

Patch Set 1: -Code-Review

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

-------------------------------------
author: Brenden Conley
date: 2013-11-26 08:48:00.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2013-11-26 22:16:18.000000000

Patch Set 1:

I tried this on Mac with a very large set of dirty files (~20k staged files, I used linux kernel repository and did a reset soft ~15k commits back in history on the master branch). The new implementation doesn't really feel faster, with all top level nodes collapsed it takes around 2 sec to refresh, when the complete tree is expanded it takes something like a minute (didn't use a stop watch).

in addition I noticed that :
- the cursor is flickering a lot so it seems there are tons of UI refreshes which we should probably suppress until the data is available
- initially after restarting Eclipse the collapsed tree of all staged files seems to be always fully expanded, is this intended ?

- Do you see similar behavior on your platform ? 
- Did you measure the performance difference ?

-------------------------------------
author: Danika Greer
date: 2013-11-26 23:06:09.000000000

Patch Set 1:

> the cursor is flickering a lot so it seems there are tons of UI refreshes which we should probably suppress until the data is available

I don't know SWT well enough to know what we can do about that.

> initially after restarting Eclipse the collapsed tree of all staged files seems to be always fully expanded, is this intended ?

The default state is expanded and we don't remember the expansion state. Maybe we should store it in some kind of settings.

> Do you see similar behavior on your platform ?

Yes, I also didn't feel any difference.

I suspect the bottleneck is currently in getting the right IResource, see point 2 in the bug report. The code in ResourceUtil uses findFilesForLocationURI and co which I've heard is slow.

I'll work on that next. In hindsight, I should probably have started with that one :).

> Did you measure the performance difference ?

No, as these tree content provider methods are called from the UI when creating the tree, it's hard to measure before/after.

Apart from that, I feel that this version is nicer, e.g. look at how setParent was done before. Now we construct the tree once and then only read it.

-------------------------------------
author: Douglas Trujillo
date: 2013-11-27 22:05:54.000000000

Patch Set 1: Code-Review+1

- flickering: I guess we need to delay reloading the staging view on indexdiff changes when long running git operations which affect the working tree are executing concurrently on the same repository, I also observed a lot of flickering/updating when doing large rebase operations which change the working tree many times in a short time. I'll discuss this with Jens.
- yes we should store the collapse state of staging view panes
- yes, this code looks nicer

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