Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TreeViewer refresh performance
TreeViewer refresh performance [message #513534] Wed, 10 February 2010 09:10 Go to next message
philipp huebner is currently offline philipp huebner
Messages: 26
Registered: July 2009
Junior Member
Hi folks,

I've messured that my tree takes over 2 seconds for a refresh on a element in atree with about 10000 elements. Thats too slow for our use cases; is there a possibility to speed this up or sth like a SWT.Virtual flag for trees ....
Re: TreeViewer refresh performance [message #513549 is a reply to message #513534] Wed, 10 February 2010 09:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5014
Registered: July 2009
Senior Member
did you turn off redrawing (tree.setRedraw(false))?

Tom

Am 10.02.10 15:10, schrieb philipp huebner:
> Hi folks,
>
> I've messured that my tree takes over 2 seconds for a refresh on a
> element in atree with about 10000 elements. Thats too slow for our use
> cases; is there a possibility to speed this up or sth like a SWT.Virtual
> flag for trees ....
Re: TreeViewer refresh performance [message #657102 is a reply to message #513549] Tue, 01 March 2011 10:39 Go to previous messageGo to next message
philipp huebner is currently offline philipp huebner
Messages: 26
Registered: July 2009
Junior Member
ahh....nope. But why....Then you disable the entire tree. I want still draw it....
Is JFace's Tree Performance really that bad? That can't be possible. It must be able to handle this....
Re: TreeViewer refresh performance [message #657120 is a reply to message #657102] Tue, 01 March 2011 10:57 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5014
Registered: July 2009
Senior Member
A refresh might mean in your case many many micro updates and to make
them into one big flush you do:

try {
tree.getControl().setRedraw(false);
// Make you UI-Updates
} finally {
tree.getControl().setRedraw(true); // Flush all changes at once
}


Am 01.03.11 16:39, schrieb philipp huebner:
> ahh....nope. But why....Then you disable the entire tree. I want still
> draw it.... Is JFace's Tree Performance really that bad? That can't be
> possible. It must be able to handle this....
Re: TreeViewer refresh performance [message #657261 is a reply to message #657120] Wed, 02 March 2011 03:48 Go to previous messageGo to next message
philipp huebner is currently offline philipp huebner
Messages: 26
Registered: July 2009
Junior Member
Ok I understand; but does this really work. I have really one call of tree->refresh. Whre do I have to add this code?


Re: TreeViewer refresh performance [message #657262 is a reply to message #657261] Wed, 02 March 2011 03:53 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5014
Registered: July 2009
Senior Member
Exactly there where i had my // Make you UI-Updates comment.

Tom

Am 02.03.11 09:48, schrieb philipp huebner:
> Ok I understand; but does this really work. I have really one call of
> tree->refresh. Whre do I have to add this code?
>
>
>
Re: TreeViewer refresh performance [message #657272 is a reply to message #657120] Wed, 02 March 2011 04:54 Go to previous messageGo to next message
philipp huebner is currently offline philipp huebner
Messages: 26
Registered: July 2009
Junior Member
But I have already cached my update events.
I have a customized tree viewer for an emf model. There are many unnecessary update events which are cached to one update, but this one update is still very slow.
Disable redrawing could only be a solution if you do it in an inherited method of the tree itself. I
Re: TreeViewer refresh performance [message #665898 is a reply to message #513534] Mon, 18 April 2011 01:07 Go to previous message
jim liu is currently offline jim liu
Messages: 37
Registered: February 2011
Location: shanghai
Member
do not refresh all tree,just refresh a tree node item?

java eclipse Search
http://javafind.appspot.com/
Previous Topic:Zest Graph Viewer reference points to null all of a sudden
Next Topic:Exceptions and DataBindingContext.bindXXX methods
Goto Forum:
  


Current Time: Sun Apr 20 06:47:36 EDT 2014

Powered by FUDForum. Page generated in 0.03802 seconds