So I'm using Jet eval

What is actually in the sample hello world? Is it just a sop(“Hello World”) or what?

There are a load of tuning options in JetPerfect that it makes sense to try to get to grips with. Turn inlining down substantially for a start. Remove bounds checking and NPE checks. A few other things like that.

Cas :slight_smile:


jc =p =a hello.prj -compile_in_perfect:-

REM Create .USG file

set JETVMPROP=-Djet.usage.list -Djet.default.classloader:application
hello.exe

REM Compile project in perfect mode

jc =p =a hello.prj -compile_in_perfect:+

set JETVMPROP=

Direct copy from the build.bat file included in the samples

[quote]Used the sample “hello world” provided with the eval pro version, and the executable produced was of size 2.1 mb…
Man this is such a joke ::slight_smile:
[/quote]
Well this is due to the bloated 1.4 API which has too many interdependencies.


 >java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

> java -verbose hello | grep "\[Loaded" | wc -l
    259

As you may see, the 1.4.2_03 VM has to load 258 Java 2 API classes just to execute “Hello, World”.

Anyway, that EXE 7zips to about 750K, which is much less than the size of the JRE. You can save extra 60K by disabling inlining completely in the project file:

-inline

Then, 2MB is just the minimum overhead for J2SE 1.4.2. Alien Flux 1.5 compiles to less than 5MB EXE without resources (images, sound, security provider classes, etc.), which 7zips to about 1.5MB. If you choose to bind resources, the result will be 13MB EXE (7zips to 9.5MB), which only needs two LWJGL native method DLLS to run.

With Java 2 1.3, the EXE would be much smaller. When running the hello sample on JRE 1.3.1_10, only 181 platform API classes get loaded.

I would therefore suggest that you try JetPerfect on a bigger project.

Worth mentioning that the AF demo (which I no longer build) actually compiled to under 5Mb with graphics and sounds. (The full version uses RMI which brings in a fair chunk of code)

Cas :slight_smile: