This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Obfuscation - optimisation?
- From: Clemens Eisserer <linuxhippy at web dot de>
- To: java at gcc dot gnu dot org
- Date: Sat, 09 Oct 2004 20:34:08 +0200
- Subject: Re: Obfuscation - optimisation?
- References: <co1hd1$52j$1@sea.gmane.org> <200411241049.15228.konqueror@gmx.de> <41A44C22.8030505@egholm-nielsen.dk> <16804.31174.893199.848014@cuddles.cambridge.redhat.com> <41A47F27.2080201@egholm-nielsen.dk> <16804.33116.532088.535302@cuddles.cambridge.redhat.com> <41A489BA.8080400@egholm-nielsen.dk> <16804.37765.414410.975709@cuddles.cambridge.redhat.com> <41A49BAF.8030904@egholm-nielsen.dk>
Hi there!
I just tried creating some manual obfuscation of some dummy classes. I
made a class with a long (50 chars) class-name, long (100 chars)
field-name and long (130 chars) method name. A similar obfuscated
class was created with one character long names. Next, I created 10000
instances of both (and kept references to all of them), and saw that
they consumed the exact same amount of memory...
This was of course a small test, but I think it's conclusive that
obfuscation on names does _not_ reduce memory footprint.
Maybe it was obvious?! :o)
Well, this is really true - Method instances do not include the name of
there classes - I think they only store something like a descriptor or a
pointer where the class-information can be looked up in a hashtable or
something like this.
But proguard does things like removing unsused stuff VERY efficient or
making methods that are never orverridden final. removes code withought
side-effects....
Well, for libraries this is stupid, but for applets or stand-alone apps
this IS indeed very helpful. It makes programs much smaller (-20-40%)
and also faster.
Of course this could also done all in gcj itself (and to be honest I
dont know whats currently done) but till its there proguard is a way to
enhance your applikation with next to null work.
Btw. I was not able to build "optimized" code with gcj, though proguard
claims to create valid bytecode (and warns of options that doesnt).
lg Clemens