Solved

Java Applet Size Reduction

Posted on 1998-09-19
5
232 Views
Last Modified: 2008-01-16
I'm desperate to reduce the size of my Java Applet.  I have taken all the measures I can think of (Jar & cab file formats, snipped all dead code, using a "Release" (not debug) build, etc), but I'm wondering if there's something non-obvious that I could do to my code that would reduce it's size?
0
Comment
Question by:sniles
  • 3
5 Comments
 

Author Comment

by:sniles
ID: 1224631
I think you misunderstood my question.  I am trying to reduce the size of the JAR, CAB and ZIP file containing the class files.
0
 
LVL 2

Expert Comment

by:triso
ID: 1224633
Hi,

Exactlly how large is "too large?"  Do you have lots of small class files or just  a few large ones?


0
 

Author Comment

by:sniles
ID: 1224634
I have several large classes, then about a dozen smaller ones.  Ideally, I'd like to reduce it's size by 20%.  It's currently about 120kb uncompressed, about 54kb when compressed in a .cab file.  If I could get a 30kb .cab file, I'd be quite happy.
0
 
LVL 3

Accepted Solution

by:
mjenkins earned 50 total points
ID: 1224635
I assume that the reason you are asking is to reduce the download, and thereby startup, time. May I suggest that if you've already optimised as best you can, split the cab/jar/zip files into smaller units. Use the -verbose option to watch the order that classes are loaded when your applet is running. Then split the cab files up so that your initial download is as small as possible to get something on the screen.

Typically, users are much more inclined to cut you slack (time-wise) once they see the first screen.
0
 

Author Comment

by:sniles
ID: 1224636
So you're saying that splitting up the cab/jar/zip files will allow the applet's screen elements to display prior to the point when the "Applet Started" message?  I have noticed that during the loading, the "Applet loaded" and "Applet initialized" messages are output (in the Java Console), then several more classes are loaded, then the "Applet Started" message is finally displayed.  To display the screen earlier, I can cut those classes that follow the "Applet Initialized"  off into a seperate jar/cab/zip? and just add that zip as a second archive= param, and a second <param name=cabbase value="myapp1.cab,myapp2.cab">  ?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
allStar challenge 1 41
mapBully challenge 6 89
Running Jira on Raspberry PI 2? 3 137
Starting to learn JAVA, 7 48
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now