|The performance optimization of updateChildren() in org.eclipse.jface.viewers.AbstractTreeViewer [message #1786903]
||Tue, 15 May 2018 09:55
| jingjing wang
Registered: July 2017
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
Powered by FUDForum
. Page generated in 0.01726 seconds