Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Home page takes long time to load when background job is running(RAP 2.3.2)
Home page takes long time to load when background job is running [message #1737083] Tue, 05 July 2016 14:48 Go to next message
Tass Burrfoot is currently offline Tass BurrfootFriend
Messages: 19
Registered: April 2015
Junior Member
My entry point class contructor has a long process handled by org.eclipse.core.runtime.jobs.Job. It looks like this

public class MyEntryPoint extends AbstractEntryPoint {
    public MyEntryPoint() {
          // fields initialization
          service.setup();
   }
}


Code of service.setup():
protected void setup(String name) {
	MyJob job = new MyJob(name) {
		@Override
		protected IStatus run(IProgressMonitor monitor) {
			exec();
			return Status.OK_STATUS;
		}
	};
	job.setUser(true);
	job.schedule();
}


The job's exec() method can take up to 4 seconds to complete. It's all about model data setup without bothering UI. The issue is: when I start up the application, the home page is loaded (rendered in browser) in about the same long time. This is an observation by eyes. I used System.nanoTime to record the execution time for AbstractEntryPoint.createContents(Composite), it prints on console as around 900ms. But the page actually loaded very slow. The rap loading image is hung there for several seconds. I don't know how to measure this from front-end. The page loading time is noticeably reduced if I removed the long process job from the constructor.

Anybody knows why? Thanks
Re: Home page takes long time to load when background job is running [message #1737736 is a reply to message #1737083] Tue, 12 July 2016 10:37 Go to previous messageGo to next message
zone whua is currently offline zone whuaFriend
Messages: 7
Registered: July 2009
Location: Wuhan China
Junior Member
1. a heavy job will cause server response client request slow. a loading logo displayed as SystemMessage-DisplayOverlay in css file.
2. another way to load data without broking ui is display.asysnRun(). but i think it's doesnt work for your case.
3. your model is not relative with client session, (your exec has not passed display) . load data in entrypoint that means every time user login will invoke exec().
if data model is shared by every client, move exec() to Bundle Activator start() or load file in ApplicationConfiguration.
Re: Home page takes long time to load when background job is running [message #1738125 is a reply to message #1737736] Fri, 15 July 2016 20:52 Go to previous message
Tass Burrfoot is currently offline Tass BurrfootFriend
Messages: 19
Registered: April 2015
Junior Member
thanks for the reply. The problem is gone after deployed. It seems that in development environment ( app launched by RAP launch file), AbstractEntryPoint.createContents() has higher priority than background thread. Not proved though.
Next Topic:How to create a mechanism to upload a .jpg, etc
Goto Forum:
  


Current Time: Tue Mar 19 06:39:17 GMT 2024

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

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

Back to the top