Local Benchmark Results

February 18, 2026 ยท View on GitHub

Local benchmark results from run.sh. These will differ from CI because of OS file caching and warm __pycache__/.

Phase 1: Training / Build Cost (one-time)

These are one-time setup costs, comparable across languages.

StepTimeWhat it does
Python first run1.98sInterprets source, creates __pycache__ bytecode
JBang export2.19sCompiles source + bundles dependencies into fat JAR
AOT training run2.92sRuns JAR once to record class loading, produces .aot cache

Phase 2: Steady-State Execution (avg of 5 runs)

After one-time setup, these are the per-run execution times.

MethodAvg TimeNotes
Fat JAR + AOT0.32sFastest; pre-loaded classes from AOT cache
Fat JAR0.44sJVM class loading on every run
JBang1.08sIncludes JBang launcher overhead
Python1.26sUses cached __pycache__ bytecode

Phase 3: CI Cold Start (simulated locally)

Clears __pycache__/ and JBang cache, then measures a single run. On a local machine the OS file cache still helps, so these numbers are faster than true CI.

MethodTimeNotes
Fat JAR + AOT0.46sAOT cache ships pre-loaded classes
Fat JAR0.40sJVM class loading from scratch
JBang3.25sMust compile source before running
Python0.16sNo __pycache__; full interpretation

How each method works

  • Python caches compiled bytecode in __pycache__/ after the first run, similar to how Java's AOT cache works. But this cache is local-only and not available in CI.
  • Java AOT (JEP 483) snapshots ~3,300 pre-loaded classes from a training run into a .aot file, eliminating class loading overhead on subsequent runs. The .aot file is stored in the GitHub Actions cache.
  • JBang compiles and caches internally but adds launcher overhead on every invocation.
  • Fat JAR (java -jar) loads and links all classes from scratch each time.

AOT Cache Setup

# One-time: build the fat JAR
jbang export fatjar --force --output html-generators/generate.jar html-generators/generate.java

# One-time: build the AOT cache (~21 MB, platform-specific)
java -XX:AOTCacheOutput=html-generators/generate.aot -jar html-generators/generate.jar

# Steady-state: run with AOT cache
java -XX:AOTCache=html-generators/generate.aot -jar html-generators/generate.jar

Environment

CPUApple M1 Max
RAM32 GB
JavaOpenJDK 25.0.1 (Temurin)
JBang0.136.0
Python3.14.3
OSDarwin

Reproduce

./html-generators/benchmark/run.sh            # print results to stdout
./html-generators/benchmark/run.sh --update    # also update this file