How to get the best performance from CACAO

There are several things you can try to get the most out of CACAO.

Use Java 1.5 Bytecode

Java 1.5 bytecode uses the LDC instruction for loading constant class references, which is much more efficient than the .class$ methods generated by compilers for the Java 1.4 platform.

You should at least compile the VM classes of CACAO targeting Java 1.5 bytecode.

Configure Options

Add the following options when configuring CACAO:

--disable-debug --disable-disassembler CFLAGS="-O2"

Add to CFLAGS any options that produce better code for your particular processor.

(Note: --disable-disassembler is not yet available in the releases, just leave it out.)

<!> If for some reason you want the CACAO interpreter to be fast, you must add the option -fno-reorder-blocks to CFLAGS, otherwise the dynamic superinstructions will not work properly.

You can also add the configure option --disable-verifier which removes all verifier code, but be aware that what you get then is no longer a JVM complying with the Java Virtual Machine Specification. You will have to trust the bytecode you execute...

(Note: --disable-verifier is currently broken; see PR81)

Contribute

If you want CACAO to be faster and have an idea how to achieve that, join us! We can always need help. :) (see CacaoChat)

cacaowiki: BestPerformanceHowto (last edited 2008-08-27 13:19:16 by StefanRing)