File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes optimize download class file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "optimize download class file" Watch "optimize download class file" New topic

optimize download class file


Joined: Feb 03, 2000
Posts: 1
hi can anybody give me a suggestion or tool which will minimize my intial downloading time of java class file. now it takes more than 8 minutes for intial download. i will be grateful if some body helps me out at the earliest.

paul wheaton

Joined: Dec 14, 1998
Posts: 20965

Are you jarring your files?
You might want to consider getting dash-O from The company I'm working for now is getting it for a similar problem. It figures out what your applet needs and doesn't need and tosses out the rest: classes, methods, attributes ... Then it obfuscates the code so that long identifiers are turned into one or two characters. They claim up to 70% compression of a jar file. Oh yeah, jarring your file is going to cut way back on the download time of your stuff cuz for every class an HTTP session is opened up. HTTP connections are expensive.
Another thing: are there parts of your program that are not run at the very beginning? You can split your code into several jar files. One that is used at the beginning and others that supplement later. This way, to get your applet started you might only need to download 20% of your program - then while your program is already running, the other 80% is being downloaded in a seperate thread.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Jack Shirazi
Ranch Hand

Joined: Oct 26, 2000
Posts: 96
Paul's complete answer left only one thing out, that the jar file should also be compressed. This compression is different and complementary to the compression achieved by Dash-O.
Applets should have their download performance strongly considered at every stage of the applet development, from the specification stage. In my book I analyze how leaving performance considerations later for applets can make a huge difference in the cost of improving the performance of the applet.
I agree. Here's the link:
subject: optimize download class file
It's not a secret anymore!