To Pack or not to Pack?

I’m back from vacation.. Hmm.. well it was not this long though.. (my last post was more than a month back).. I traveled to few places, exploring new things.. You may view the some of the photos here!

Well was busy with many other things as well..
Oracle OpenWorld, Mobile Application Conference..

Anyway back to the topic.. Is it always good to compress the jar while deploying the Java/JavaFX application? What will be its impact on startup time? Or may be I was doing too much pack and unpack of luggage during vacation and hence the thought is still lingering in my mind?!

I think the answer depends on the application and target users. Pack helps to compress the jar file size (reduce download time). But it may increase the start-up time due to additional step – unpack. So if the application is too small, it may be better not to use compressed jar. Also if the target audience has very good bandwidth, then user may not see the benefit of reduced download time.

Applet – Pack Applet – No-Pack

Note: Above example is not the best to demonstrate any significant difference in warm start-up time

Also set update check to background in jnlp files as shown below.. Please refer to tech tip on start-up time for more information.

<update check="background"/>

JavaFX packager was generating jnlp files with missing / for close tag for applet-desc – param tag. Due to this any subsequent tags were getting ignored. So we need to ensure that all tags are properly closed. This issue with javafxpackager is resolved (not be available in 1.2)

<applet-desc ... >
<param name="MainJavaFXScript" value="..." />

Best way to validate the jnlp is to launch the application and view the jnlp in Java Cache Viewer. Ensure that all entries are reflected properly. Update check must be set to “background” and not “timeout”.

Well.. I never thought that one character (or lack of it) can contribute so much towards start-up time! Keep exploring!!


About Rakesh Menon

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: