You Are Here:

Community: Developer Discussion Boards

#1 Old reducing jar file size - 2003-05-14, 17:40

Join Date: Mar 2003
Posts: 21
doomer999
Offline
Registered User
Hi,

I have some questions related to reducing the jar file size.

1. If I use Vector() instead of self-programmed linked list, can the size be reduced?

2. Is it true that final static variables consume more space than final variables?

3. In Sun ONE Studio, there are many levels for the compression of jar files. Will higher compression result in lower speed performance?

Thank you
Nelson
Reply With Quote

#2 Old 2003-05-14, 20:25

Join Date: Mar 2003
Posts: 148
Location: USA, FL
dpolyakov
Offline
Game Artists
1) Vector vs Linked list. IMHO Linked list with the same amount of elements will be bigger, cause you gotta keep references to the next elements, but in the vector you have only size of this vector.

2) hm... As I remember, final means like const in C/C++, but static exists as one instance for all instances of this class. IMHO, everything depends on compiler. If it inlines final variables (no matter if it static or not) the sizes are equal; otherwise, the overall size of _set_ of the same class with final static variable (one instance of this variable for everyone) will be less than size of _set_ of the same class with just final variable.

3) Usually, if you do optimization for speed, your code becomes bigger. For example, a loop has to be unwound in order to avoid jumps and sometimes counter's comparison. Thus, I would say, to decrease .jar file it is needed to use obfuscator, use less classes, and work on logic to reduce number of variables.

Dima.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia