NativeJavaGcjPackages

Differences between revisions 2 and 3
Revision 2 as of 2005-11-06 11:19:35
Size: 1560
Editor: AAubervilliers-153-1-9-33
Comment:
Revision 3 as of 2005-11-07 15:19:00
Size: 1626
Editor: 209
Comment: remove "may/should"
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
 * To workaround limits on the number of class files and size of the byte-code, the compilation should be done using the aot-compile-deb binary found in the java-gcj-compat package (maybe move that to the gij packaged).  * To workaround limits on the number of class files and size of the byte-code, the compilation is done using the aot-compile-deb script.
 * update aot-compile-deb to compile the class/jar files in the tempor
ary installation directories and install the results in the -gcj package(s).

Summary

For each package containing java code, provide a corresponding -gcj package with java compiled to native code.

Rationale

Faster execution compared to the gij-interpreted java code. Tradeoff is higher memory consumption.

Design

  • Each jar file in a package installed into /usr/share/java has a corresponding file /usr/lib/gcj-4.0/ holding the corresponding so file containing the natively compiled java code.
  • The jar file is built using the default java compiler using the arguments -O2 -fjni -findirect-dispatch.
  • To workaround limits on the number of class files and size of the byte-code, the compilation is done using the aot-compile-deb script.
  • update aot-compile-deb to compile the class/jar files in the temporary installation directories and install the results in the -gcj package(s).
  • The debugging symbols are provided in a corresponding gcjdbg package.

Implementation

  • Provide an example implementation for one package:
    • add the two packages to the control file
    • call aot-compile-deb from the deb file (maybe add a debhelper to do that)
    • add gcj-dbtool calls to the postinst and preinst files (maybe add a debhelper to do that)
    • strip the symbols and put the symbols into the -gcjdbg package.
  • Update all other java packages (about 150 in main and universe)

NativeJavaGcjPackages (last edited 2008-08-06 16:38:46 by localhost)