Speed Up Compilation
Harpe invokes the Jo compiler each time the model calls runCode. The default
Jo launcher starts the compiler on the JVM, so its startup time is paid on every
call. Compiling the launcher to a native binary makes repeated calls faster.
This is an optional performance optimization. It does not change the capability boundary or the generated program.
Note. The best performance comes from a long-running JVM compilation server, which pays the startup cost once rather than on every call. Please contact us if you need technical support for setting up a compilation server.
Build the native launcher
Install GraalVM and confirm that
native-image --version works. Then compile the Jo version you currently use:
cd "$HOME/.jo/compilers/$(jo --version)/bin"
native-image --no-fallback -jar jo.jar -o jo.native
In that directory, edit the jo launcher and replace its last line with:
exec "$BIN_DIR/jo.native" "$@"
Verify the launcher:
jo --version
Harpe replays the compiler launcher recorded when the sandbox was built, so
subsequent runCode calls use the native binary.
See Install Jo for the upstream installation instructions and native-launcher tip.