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

Bug 179540

Summary: [Model Scalability] [Performance] Use eclipse virtual tree in the Log View editor
Product: z_Archived Reporter: Valentina Popescu <popescu>
Component: TPTPAssignee: Joe Toomey <jptoomey>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: bjiang, jerome.gout, paulslau
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 180986    
Attachments:
Description Flags
patch none

Description Valentina Popescu CLA 2007-03-27 10:34:24 EDT
Starting with Eclipse 3.2, the platform had made available a set of virtual controls for representing tree and table views. 
Using this approach, tree items are only created if they are visible. As an example, if a tree has 1000 items but the current window can display only 20 of them, only these 20 items will be created. As the user scrolls the view, the items becoming visible will be created, on demand.

The new implementation has a big performance improvement for large trees since the UI will only query the model for items that are currently visible. A hidden item will be removed from the tree, so the number of UI tree nodes is reduced to the number of nodes visible at any point in time. 
No UI changes are required for this new implementation. 


Implementation details for virtual tree support in the LogViewer editor. 

Code changes in the o.e.h.test.ui plugin

In LogEventsBlock.java :

1. Set the virtual tree to the log view
		Tree tree = toolkit.createTree(client, SWT.FULL_SELECTION | SWT.SINGLE | SWT.VIRTUAL);

2. Set the content provider to be TestLogEventsLazyPathContentProvider, implementing the ILazyTreePathContentProvider interface

3. Set this option on the tree viewer		viewer.setUseHashlookup(true);


TestLogEventsLazyPathContentProvider new content provider

see patch attached
Comment 1 Valentina Popescu CLA 2007-03-27 10:35:18 EDT
Created attachment 62103 [details]
patch
Comment 2 Jerome Gout CLA 2007-03-29 03:31:21 EDT
I think that this defect would rather be in the Bianca's defect bucket.

Feel free to re-assign if it is not the case.
Thanks
Comment 3 Marius Slavescu CLA 2007-04-02 17:08:50 EDT
Make sure you also include some navigation actions on the tree, otherwise will be hard to know where you are.

Some possible actions are:
- go to parent, 
- go to next sibling
- go to prev sibling

The user should also be protected against expensive expand operations, through the ability to limit the number of levels/elements retrieved.

Collapse operation should enable the GC of tree elements (if possible).
Comment 4 Paul Slauenwhite CLA 2007-04-04 12:12:03 EDT
Assigning to Joe.
Comment 5 Paul Slauenwhite CLA 2007-04-04 12:23:47 EDT
Valentina has successfully modified the Test Log view tree to only create items when they are visible:
  -Satisfactory or better performance (initial target: 1,000,000 execution events):
  -1000 execution events: Minimal impact
  -240 MB test log: some delay when scrolling from first to last event.
-Current prototype does not query the database directly but traverses the EMF test execution model using the EMF paging list based on the existing log test log support.
-Requires an analysis of the memory consumption to confirm smaller footprint:
  -Confirmation GC runs and cleans non-visible branch/leaf nodes (e.g. when does the virtual tree clean-up?).
  -Verify no memory leaks (e.g. is memory ever released or is it memory consumption accumulative).
Comment 6 Joe Toomey CLA 2007-04-30 10:03:30 EDT
I have committed the code from this patch, along with several additional fixes to correct the setSelection behavior with the virtual tree.  (By default, it creates all siblings of each node in the tree path.)  The majority of this work was delivered under 180986.
Comment 7 Paul Slauenwhite CLA 2007-06-02 14:51:57 EDT
Reporter: Please verify and close in preparation for shutting down the TPTP 4.4 release.  Thanks.
Comment 8 Joe Toomey CLA 2007-07-10 15:47:14 EDT
Verified in 4.4.  Closing.
Comment 9 Paul Slauenwhite CLA 2009-11-23 10:38:26 EST
Correcting component.