Skip to main content

Dire performace getting initial context from web start app.

14 replies [Last post]
phenderson
Offline
Joined: 2005-02-16

I've run into what can only be described as a dire performance problem.

The setup
A web start loaded stand alone client application.
(Note: I am not using the built in web start client container! it has too many issues, looks like a demo, that was never finished, Sorry Tim).

The client app works with poor performance from the debugger (About 2 seconds).
Yet when loaded with Web Start, this bit of code

<br />
        System.setProperty("org.omg.CORBA.ORBInitialHost", "starjar-partech");<br />
        initial = new InitialContext();<br />

Takes over 17 seconds!
With the local cpu flat out, NO network io, and no disk io.

One has to wonder WTF is InitialContext doing?

Tested with jars from Glassfish v2 b35 and v2 b25 all running Java 6

The web start app Is signed with full access.
Also I have to nuke the security manager to preven orb puking on it's feet.

<br />
        System.setSecurityManager(null);<br />

I'll put together a test set tomorrow, which reproduces the problem. Althought I suspect it will be a waste of time and fall on dead ears.

Peter Henderson

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tjquinn
Offline
Joined: 2005-03-30

First, for Peter.

Thanks for the feedback. I had accumulated many files in my temp directory and cleaning it out helped a great deal. (I got the idea after using the NetBeans profiler to see where the time was going. On the Windows system I was using a JDK class working with a secure random number seed was invoking java.io.File.list which took more than 13 seconds before I cleaned out the temp directory. (I had a LOT of files that had piled up there.)

And just to be clear, the directory of interest is the one pointed to by the java.io.tmpdir system property.

There may be other things going on in your case. Just out of curiosity, how many files resided in your temp directory before you cleaned it out?

Now for Steve,

Can you please use IssueTracker to open a GlassFish enhancement request for this? Java Web Start itself is in control of how long the splash screen stays visible. It might be possible for the app client container to display the splash screen again when it starts up.

Another additional enhancement could be for the app client container to call back to an optional developer-supplied class with progress updates. Then the developer could choose whether and how to inform the user of the start-up activities.

Of course the best of all would be if all the start-up activities happened so fast that neither of these steps was needed.

- Tim

P.S. Peter, your latest reply appeared while I was editing this the first time.

to add the P.S.

Message was edited by: tjquinn

suttridge_farm
Offline
Joined: 2006-01-27

Hi Peter & Tim,

Thanks Peter for the ideas about using manual look-ups instead of annotation injection and a user progress screen for the initialisation - I must admit I was being lazy, and hadn't thought of doing that. Yes, Tim, I'll put in an enhancement request - I think the callback would probably be the nicest appraoch, but I guess it does mean that the app client's user interface thread has full control before the injection of annotated beans starts, so that it can get some sort of display going, or else the JWS splash screen must persist with callbacks until all injection processing is finished (gee, am I actually making sense here ?!?).

Ta,

Steve

tjquinn
Offline
Joined: 2005-03-30

Hi, Peter.

I see the same behavior you described. Running the app client run from NB it reports taking about 1.7 seconds on my system (after running it once to get things warmed up). The Java Web Start launch reports taking between 17 and 18 seconds.

I am not yet sure why this might be. I'll be involving people who are closer to the naming support to look at this.

- Tim

phenderson
Offline
Joined: 2005-02-16

Thanks for looking into this Tim!

It's good that the problem is reproducable. 1st step on the road to being fixed ;-)

Let me know if there is anything I can do to help.

Regards

Peter Henderson.

tjquinn
Offline
Joined: 2005-03-30

Hi, Peter.

Sorry I have taken so long to pick up this thread again.

I have a possible theory. If you are still seeing this problem - please try it again before changing anything if you can to get a reliable baseline measurement - can you please try cleaning out your temporary directory as much as you can and then launching the app client again (using Java Web Start)?

As encouragement to do that, I'll hold back why I think this is at all related until you have a chance to try it!

- Tim

phenderson
Offline
Joined: 2005-02-16

Hi Tim

I have just tried the test again.

Running on Glassfish 2 build 41

Base line
Takes ~12 seconds to get an initial context.

Cleared out my Web Start cache. Everything deleted.
/tmp is empty
/home/peter/tmp also empty.

Similar timings.

Hope this helps

Peter.

suttridge_farm
Offline
Joined: 2006-01-27

Hi Peter & Tim,

Just to put my oar in here for a moment - I have been wanting to put in an enhancement request for a while now. When starting a client app from JavaWebStart, it would be nice if the JWS splash screen would remain until the UI of the client app actually appears. Because of the long start-up, particularly when there are a number of remote beans to be injected into the app client, there is no user feedback that anything is happening between the time the splash screen disappears, and the actual user interface of the client app appears (can be up to a minute). BTW, I'm using EventQueue.invokeLater in the app client main() to set the main JFrame of the app client visible - I don't know if this is the preferred method or not.

Regards,

Steve.

phenderson
Offline
Joined: 2005-02-16

Hi Steve

I would assume that the Application Client Container (ACC) which is what you are using when running your client via the official web start method, has no means of knowing if you app has a gui.
As far as the ACC is concerned, it just injects into the main class and runs it. So the to answer your question, I don't think there is a solution to the awful wait before the splash is displayed.

As an aside.
I ran into this issue a while back, and decided that using annotations in the client app to inject resources was generally a very bad idea. I had no control and could not tell the user what was going on.
I fixed this by removing all the annotations, replacing them with lookups manually. At least this way I could keep the user entertained with a pretty please wait screen and some form of progress bar.

Hope this helps

Peter.

phenderson
Offline
Joined: 2005-02-16

As promised, a demo application to show this problem.

http://www.starjar.com/glassfish_slow_initial_context

And the bug tracking issue
https://glassfish.dev.java.net/issues/show_bug.cgi?id=2399

Would appreciate it, if someone could run the demo and confirm the problem.

Regards Peter Henderson.

Ryan de Laplante

This may be completely un-related... or not? A while back I encountered
a problem when using a JMS client from stand alone application. It
brought the JVM to it's knees:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=1545

Ryan

glassfish@javadesktop.org wrote:
> As promised, a demo application to show this problem.
>
>
> http://www.starjar.com/glassfish_slow_initial_context
>
> And the bug tracking issue
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=2399
>
>
> Would appreciate it, if someone could run the demo and confirm the problem.
>
>
> Regards Peter Henderson.
> [Message sent by forum member 'phenderson' (phenderson)]
>
> http://forums.java.net/jive/thread.jspa?messageID=203600
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Binod

glassfish@javadesktop.org wrote:

>I've run into what can only be described as a dire performance problem.
>
>The setup
>A web start loaded stand alone client application.
>(Note: I am not using the built in web start client container! it has too many issues, looks like a demo, that was never finished, Sorry Tim).
>
>The client app works with poor performance from the debugger (About 2 seconds).
>Yet when loaded with Web Start, this bit of code
>
>[code]
> System.setProperty("org.omg.CORBA.ORBInitialHost", "starjar-partech");
> initial = new InitialContext();
>[/code]
>
>Takes over 17 seconds!
>
>
Is that only when you first run your application? Or Does this happen
each time your run the webstart app?

- Binod

>With the local cpu flat out, NO network io, and no disk io.
>
>One has to wonder WTF is InitialContext doing?
>
>
>Tested with jars from Glassfish v2 b35 and v2 b25 all running Java 6
>
>
>
>The web start app Is signed with full access.
>Also I have to nuke the security manager to preven orb puking on it's feet.
>[code]
> System.setSecurityManager(null);
>[/code]
>
>
>
>I'll put together a test set tomorrow, which reproduces the problem. Althought I suspect it will be a waste of time and fall on dead ears.
>
>
>
>Peter Henderson
>[Message sent by forum member 'phenderson' (phenderson)]
>
>http://forums.java.net/jive/thread.jspa?messageID=203281
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

phenderson
Offline
Joined: 2005-02-16

The delay is every time I run the web start application.

tjquinn
Offline
Joined: 2005-03-30

Hi, Peter.

From the original: [i]Note: I am not using the built in web start client container! it has too many issues, looks like a demo, that was never finished,[/i]

Please make sure that your concerns about Java Web Start support are covered by existing issues, or open more to record what you see as shortcomings. Given the time and people available we implemented what we could and are counting on feedback to help guide efforts to improve the feature.

We'll look forward to the example. Please be sure to let us know what OS and hardware you are using.

Again from the original post: [i]Althought I suspect it will be a waste of time and fall on dead ears.[/i]

Sorry if you feel like you are not listened to. That's not the case. We may not be able to get to things as quickly as you - or we - want us to, but we try very hard not to ignore what the community is saying.

-Tim

phenderson
Offline
Joined: 2005-02-16

1st I should appologize for the short tone of last nights email. It was late, I was tired + on site, etc

In the above tests. The client and server are both running linux.

I'll reveiw my list of concerns regarding the web start client container, and ensure all are in the issue tracker.

Regarding deaf ears. I sometimes wonder if my problem demo applications are used. Would be nice, just for my sanity, for an independant person to run the demo and say "yep, see the same problem".

Peter Henderson