You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
29
+
30
+
| Method | Time | Notes |
31
+
|--------|------|-------|
32
+
|**Fat JAR + AOT**|**0.46s**| AOT cache ships pre-loaded classes |
33
+
|**Fat JAR**| 0.40s | JVM class loading from scratch |
34
+
|**JBang**| 3.25s | Must compile source before running |
35
+
|**Python**| 0.16s | No `__pycache__`; full interpretation |
36
+
37
+
## How each method works
38
+
39
+
-**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.
40
+
-**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.
41
+
-**JBang** compiles and caches internally but adds launcher overhead on every invocation.
42
+
-**Fat JAR** (`java -jar`) loads and links all classes from scratch each time.
Copy file name to clipboardExpand all lines: html-generators/benchmark/README.md
+1-71Lines changed: 1 addition & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,74 +37,4 @@ Python's `__pycache__/` serves a similar purpose — it caches compiled bytecode
37
37
38
38
## Local Benchmark
39
39
40
-
The local benchmark script runs all three phases on your development machine. Local results will differ from CI because of OS file caching and warm `__pycache__/`.
41
-
42
-
### Phase 1: Training / Build Cost (one-time)
43
-
44
-
These are one-time setup costs, comparable across languages.
45
-
46
-
| Step | Time | What it does |
47
-
|------|------|-------------|
48
-
| Python first run | 1.98s | Interprets source, creates `__pycache__` bytecode |
49
-
| JBang export | 2.19s | Compiles source + bundles dependencies into fat JAR |
50
-
| AOT training run | 2.92s | Runs JAR once to record class loading, produces `.aot` cache |
51
-
52
-
### Phase 2: Steady-State Execution (avg of 5 runs)
53
-
54
-
After one-time setup, these are the per-run execution times.
55
-
56
-
| Method | Avg Time | Notes |
57
-
|--------|---------|-------|
58
-
|**Fat JAR + AOT**|**0.32s**| Fastest; pre-loaded classes from AOT cache |
59
-
|**Fat JAR**| 0.44s | JVM class loading on every run |
60
-
|**JBang**| 1.08s | Includes JBang launcher overhead |
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.
66
-
67
-
| Method | Time | Notes |
68
-
|--------|------|-------|
69
-
|**Fat JAR + AOT**|**0.46s**| AOT cache ships pre-loaded classes |
70
-
|**Fat JAR**| 0.40s | JVM class loading from scratch |
71
-
|**JBang**| 3.25s | Must compile source before running |
72
-
|**Python**| 0.16s | No `__pycache__`; full interpretation |
73
-
74
-
### How each method works
75
-
76
-
-**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.
77
-
-**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.
78
-
-**JBang** compiles and caches internally but adds launcher overhead on every invocation.
79
-
-**Fat JAR** (`java -jar`) loads and links all classes from scratch each time.
## Phase 3: CI Cold Start (fresh runner, no caches)
169
+
## Phase 3: CI Cold Start (simulated locally)
170
170
171
-
Simulates a CI environment where every run is the first run.
172
-
Python has no \`__pycache__\`, JBang has no compilation cache.
173
-
Java AOT benefits from the pre-built \`.aot\` file restored from actions cache.
171
+
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.
174
172
175
173
| Method | Time | Notes |
176
174
|--------|------|-------|
@@ -179,10 +177,10 @@ Java AOT benefits from the pre-built \`.aot\` file restored from actions cache.
179
177
| **JBang** | ${JBANG_CI}s | Must compile source before running |
180
178
| **Python** | ${PY_CI}s | No \`__pycache__\`; full interpretation |
181
179
182
-
## How It Works
180
+
## How each method works
183
181
184
-
- **Python** caches compiled bytecode in \`__pycache__/\` after the first run, similar to how Java's AOT cache works.
185
-
- **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.
182
+
- **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.
183
+
- **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.
186
184
- **JBang** compiles and caches internally but adds launcher overhead on every invocation.
187
185
- **Fat JAR** (\`java -jar\`) loads and links all classes from scratch each time.
0 commit comments