Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345498

Summary: [client] Severe scalability problem with multi-select in navigator
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Screen shot
none
Error page none

Description John Arthorne CLA 2011-05-11 16:13:56 EDT
I20110511-1000

I am working in a folder containing about ten sub-folders. One of those folders has about 20 files in it. If I try to select all of those files, the Navigator blows up after selecting about 12 files. I can see each time I select another file it slows down. There seems to be a severe scalability problem in the logic that computes copy/move targets on a multi-selection.
Comment 1 John Arthorne CLA 2011-05-11 16:19:37 EDT
Created attachment 195425 [details]
Screen shot

You can see the file layout in the screen shot. If I "go into" the images folder, I can then select all files. So, it seems to be a function of the number of parents, siblings, etc.
Comment 2 John Arthorne CLA 2011-05-11 16:20:13 EDT
Setting to major. This crashed FF4, and gave me the "Aw, snap" screen in Chrome.
Comment 3 John Arthorne CLA 2011-05-11 16:21:59 EDT
Created attachment 195426 [details]
Error page
Comment 4 Susan McCourt CLA 2011-05-11 18:54:23 EDT
I should cap the number of suggestions.
From a UI point of view, it doesn't help to crowd a ton of choices in a menu anyway.

The fact that we are repeating these computations as the selection changes (rather than waiting until the user opens the menu) is covered in bug 338887.
Comment 5 John Arthorne CLA 2011-05-12 13:33:47 EDT
Another possible simple optimization is to only compute suggestions for one file in any given directory. Presumably all files in the same directory will have the same suggestions. Whether I have one file or a hundred files selected in a folder, the suggestion computation should be similar.
Comment 6 Susan McCourt CLA 2011-05-18 19:14:53 EDT
For my win7 box on FF4, the "crap out" was at about 45 selections.  In fact, my browser hung, and since the selections were remembered for me by Orion, I hung again when restarting the navigator.

fixed by capping in both ways discussed.
- since we only care about the parent of a selected file, we need only consider the first file encountered in each folder.
- having eliminated all files with duplicate parents, it's still too crowded to build a menu with every possible parent/child/sibling of the selections in it.  Capped it at 5.  (In practice, many of the selected folders *are* siblings or parent/children so capping it usually just caps the redundant comparisons rather than taking away possible choices.)  

I found a bunch of other redundant/embarrassing things such as stripping the same file path over and over, recomputing the roots too many times, etc.

That said, you can still get a small "hiccup" every 8-10th selection that feels like a gc.  But you don't hang.

I'm marking this bug fixed because two more things will improve this:
- in bug 338887 we won't do computation until the menu opens so this work won't be repeated every time an item is selected.
- in bug 343625 we'll hook in the directory prompter.  Once the user can select any directory, I plan to greatly reduce the number of choices shown in the menu.
Comment 7 Susan McCourt CLA 2011-05-18 21:28:51 EDT
.