Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » The performance optimization of updateChildren() in org.eclipse.jface.viewers.AbstractTreeViewer(The performance optimization of updateChildren() in org.eclipse.jface.viewers.AbstractTreeViewer)
The performance optimization of updateChildren() in org.eclipse.jface.viewers.AbstractTreeViewer [message #1786903] Tue, 15 May 2018 09:55
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
In order to improve the refresh performance of tree viewer structure. We analyzed the refresh process of tree viewer, and got several optimization ponits. These optimizaions are all about updateChildren() in AbstractTreeViewer
1. About the process of creating new tree item. In its current process, when a new element is added, there is a dislocation of the tree items. All tree items after dislocation will be re-associated and execute updateItem() operation. We think this process is a little time-consuming. In our opinion, when there is a dislocation, invoking createTreeItem() to create a new item of the new element, and update the children item list. This idea can avoid the process of re-associated and updateItem().
2. About the invoke of updatePlus() in updateChildren(). In its current process, all tree items which does not change its element will invoke updatePlus(). In our analysis, we think that adding/deleting element will effect the "+/-" icon of its parent tree node, and the "+/-" icon of its self tree node of adding element. So only parent tree node and tree node of adding element invoke updatePlus()
3. About the invoke of isExpandable(Item item, TreePath parentPath, Object element). The function isExpandable(Item item, TreePath parentPath, Object element) will be invoked in many palce. But its second parameter "parentPath" will set null in the fuction optionallyPruneChildren(Item item, Object element), updateChildren() and updatePlus(), this makes isExpandable() execute not so much efficiently. Our idea is to get the "parentPath" before invoking isExpandable(Item item, TreePath parentPath, Object element).

And these are our optimization idea of AbstractTreeViewer. AbstractTreeViewer is a very important and basic class, we are worried about these optimizations will have other unknown effects.
We share our idea to everyone, we hope to get some questions and advises from you. We think your reply will be very helpful and useful for us.
Thank you very much!

[Updated on: Tue, 15 May 2018 10:58]

Report message to a moderator

Previous Topic:Problems with checked elements in CheckboxTableViewer based on virtual table
Next Topic:Pack tree columns on property sheet entry change
Goto Forum:
  


Current Time: Fri Apr 26 19:52:11 GMT 2024

Powered by FUDForum. Page generated in 0.03207 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top