| Reply | « Previous Thread | Next Thread » |
|
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 |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|