This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Optimizing for download size
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: <java at gcc dot gnu dot org>
- Date: Thu, 21 Nov 2002 23:51:13 +0100
- Subject: Optimizing for download size
Does GCJ have an option to aggressively optimise for download or zipped size(*)?
- I'm using Java and Eclipse SWT instead of Visual Basic and there
is one area where Visual Basic scores over Java: download size.
- My application uses JNI in order to use SWT and serial communication(using either
javax.comm from Sun or www.serialio.com). I'm following the exiting JNI developments
closely. :-)
- Presumably such "aggressive" size optimisation would need a list
of all classes and maybe even methods actually used by the program.
I suppose some first approximation could be done by scanning the
class dependencies starting out from "main", but perhaps running the
app with some instrumentation to generate a "use list" would make
more sense(where the user would be responsible for exercising all
code paths).
* My application will be zipped for download, and I don't particularly care
how big the application is unzipped. My initial attempt
at using GCJ for a straightforward "hello world" gave me a 2.5MB exe
file that was 700k zipped. Thats pretty darn good!