Obfuscation - optimisation?

Andrew Haley aph@redhat.com
Wed Nov 24 12:09:00 GMT 2004


Martin Egholm Nielsen writes:
 > Hi,
 > 
 > (Weird, I cannot see my own posting in the newsgroup [on gmane], but 
 > yours is there...)
 > 
 > >>A question came to mind:
 > >>When using classes one can use obfuscation/optimisation tools on 
 > >>class-files (e.g. progaurd) in order to reduce footprint, etc. Are there 
 > >>any similar possibilities with gcj?
 > >>I reckon I cannot use progaurd since gcj cannot compile to native from 
 > >>class-files, right?!
 > > gcj can compile from class files to native but its less effective.
 > Ofcourse it can - silly me. I use "gcj -c some.jar" all the time...
 > But how is it less effective?

There isn't quite as much information when compiling from jar files.
It's not a huge difference, but it can make some difference to
performance.

 > But that is then the way to go - obfuscation on class-basis and then 
 > straight ahead?!

Well, what do you want to achieve?  All that "obfuscation" would do in
the gcj context is break debugging.

It says here:

"The shrinking step produces the best results for programs that use
only small parts of their libraries. The obfuscation step can
significantly shrink large programs even further, since the
identifiers of their many internal references can be replaced by short
identifiers.

"Timings are mainly governed by the fixed overhead of reading jars and
initializing data structures. The actual shrinking, optimization, and
obfuscation are typically fast in comparison.

"Memory usage (the amount of physical memory used by ProGuard while
processing) is governed by the basic java virtual machine and the
total size of the library jars and program jars."

Andrew.



More information about the Java mailing list