You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "John C. Turnbull" <oz...@ozemail.com.au> on 2009/01/16 08:04:00 UTC

Strange applet delay revisited

I posted some time ago on this issue and now I have tracked down exactly
where the delay is happening.

 

Basically, I have an applet using Batik which loads a few SVG canvasses, one
of which includes a JavaScript based animation.  When I run the applet
directly from the local file system, it all loads and runs the animation
quite promptly.  However, when I run the exact same applet served up from a
GlassFish server on the local machine, there is a long delay before the
animation appears to run and after other static canvasses have rendered.
When run from a GlassFish server over the internet, the delay is even
longer.

 

Anyway, I have tracked the delay to the following line in
BaseScriptingEnvironment#loadScript():

 

interpreter.evaluate(reader, desc);

 

So for some reason, the script takes longer to evaluate when the applet is
served up from GlassFish than it does when it's run from the local file
system.  Why would this be?  Does the interpreter perhaps need to load some
classes/JARs in order to evaluate the script?  This would explain the longer
delay over the internet at least but not really why it also happens with a
local GlassFish server.  Any other thoughts?  Note that it's not the
application JAR being loaded that's the problem as I have used ProGuard to
combine all the JARs into one and other static canvasses have loaded and
rendered before the scripting delay happens.

 

Thanks,

 

-JCT