Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Switching Views taking a long time on first attempt to load that view.(Switch between 2 views, takes around 3+ seconds the first time it loads.)
Switching Views taking a long time on first attempt to load that view. [message #902444] Fri, 17 August 2012 15:24 Go to next message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
Hi,

I have 2 pretty simple views, with tables that load data. The loading of the data happens in an Eclipse Job outside the UI Thread. When I first login, the first view displays fine, and data is loaded. When I try to switch to the second view, the tab for the view activates, but it takes up to 5 seconds for the view to load. After that, you can switch back and forth between the views in a normal manner.

I have tried commenting out the code for the data generation jobs, which happen on partActivated(), and also commented out code for saving dirty state which happen in partDeactivated(). I still have a long delay when switching views the first time.

The views dont have any fancy code really, just a TableViewer with some Action toolbars, and the Eclipse Jobs to load the data.

Any idea what could be causing this? Is this normal behavior?

Regards,

George
Re: Switching Views taking a long time on first attempt to load that view. [message #902464 is a reply to message #902444] Fri, 17 August 2012 17:59 Go to previous messageGo to next message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
I stripped out all jobs, and only left widget creations, and listener attachments, and it still seems to take a few seconds to switch views. I come to the conclusion that lag is normal, for creation of objects and listeners, and that all we can do is block UI actions until load is complete.
Re: Switching Views taking a long time on first attempt to load that view. [message #902556 is a reply to message #902464] Sat, 18 August 2012 11:54 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
George,

what exactly do you mean with "switch view"? Are you opening a vie wfor
the first time?
Anyhow, this shouldn't take seconds - views usually open almost
instantly. How many widgets does your view create initially?

Regards,
Rüdiger


On 17.08.2012 19:59, George R Malary wrote:
> I stripped out all jobs, and only left widget creations, and listener
> attachments, and it still seems to take a few seconds to switch views.
> I come to the conclusion that lag is normal, for creation of objects and
> listeners, and that all we can do is block UI actions until load is
> complete.--
Rüdiger Herrmann
http://codeaffine.com
Re: Switching Views taking a long time on first attempt to load that view. [message #902576 is a reply to message #902556] Sat, 18 August 2012 14:54 Go to previous messageGo to next message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
Yes, opening the second view for the first time is taking unusually long.

I've stripped the view down, and the problen only occurs when I add a composite with a tableviewer. The tableviewer registers a selection provider.

The view as a whole is this:

The view has some actions in the toolbar. It the shows a tableviewer and runs an eclipse job to populate the table. Each row has an edit icon. When clicked, a details composite is opened. The details composute and tableviewer composite are in a Stack layout.

So when switching from the initially loaded view, to the second view, thw problem seems to be happening when creating the tableviewer. I've added sysouts to try and see where the felays are happening, and it seems maybe to have to do with the selection provider, but that's just a guess.

Regards,
Re: Switching Views taking a long time on first attempt to load that view. [message #902700 is a reply to message #902576] Sun, 19 August 2012 22:36 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
Check the CPU usage on the browser PC. Sounds like it is spending the few seconds constructing all the widgets for the view. IE6/7/8 are fairly slow doing this.
Re: Switching Views taking a long time on first attempt to load that view. [message #902760 is a reply to message #902576] Mon, 20 August 2012 10:17 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
to track down the performance problem in detail you should use a
profiler like YourKit or VisualVM.
But usually, it's the number of widgets (table items are also widgets)
that slows down the UI creation.
Hence, to speed up the UI createion it is best to limit the number of
widgets that are initially shown. Did you try to limit the number of
table items or use a VIRTUAL table? Do you crate the details composite
on demand?
If you think it is the SelectionProvider, did you disable the
SelectionProvider code and check if the delay is gone?

Regards,
Rüdiger

On 18.08.2012 16:54, George R Malary wrote:
> Yes, opening the second view for the first time is taking unusually long.
>
> I've stripped the view down, and the problen only occurs when I add a
> composite with a tableviewer. The tableviewer registers a selection
> provider.
> The view as a whole is this:
>
> The view has some actions in the toolbar. It the shows a tableviewer and
> runs an eclipse job to populate the table. Each row has an edit icon.
> When clicked, a details composite is opened. The details composute and
> tableviewer composite are in a Stack layout.
>
> So when switching from the initially loaded view, to the second view,
> thw problem seems to be happening when creating the tableviewer. I've
> added sysouts to try and see where the felays are happening, and it
> seems maybe to have to do with the selection provider, but that's just a
> guess.
>
> Regards,


--
Rüdiger Herrmann
http://codeaffine.com
Re: Switching Views taking a long time on first attempt to load that view. [message #902872 is a reply to message #902760] Mon, 20 August 2012 19:46 Go to previous message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
Thank you for your help. I have found the problem, and the view no longer takes very long to load, only about 1-2 seconds.

My problem was that I was getting a session ID from the HTTP session store in a background runnable, and each time I got that session id. I would have the thread sleep for half a second, waiting for completion. This was happending a few times, causing a few second delay.

Thanks again for your help.
Previous Topic:Java FX on RAP application
Next Topic:RAP on OSGi/Virgo in a cluster
Goto Forum:
  


Current Time: Sun Nov 28 03:41:48 GMT 2021

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

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

Back to the top