Commit df6f60c
perf(parparvm-tests): diagonal JDK matrix, cache JavaAPI, parallel forks (#5198)
The vm/tests suite ran ~60 min serially. Three changes cut that without
losing test coverage:
1. Diagonal compiler matrix. BytecodeInstructionIntegrationTest#provide-
CompilerConfigs (the shared @MethodSource for RuntimeSemantics, Target,
Bytecode, CleanTarget, Smoke, NativeAudit, FileClass, ...) built the full
triangular (compiler-JDK x target-bytecode) cross-product: 15 combos, so
every parameterized method ran 15x. The translator consumes bytecode, which
is governed by the *target* level, so compiling a given target with five
different JDKs mostly re-tested identical bytecode shapes. New
CompilerHelper.getDiagonalCompilers() keeps each target exercised by its
matching JDK (8->8, 11->11, 17->17, 21->21, 25->25) = 5 combos. The biggest
class (JavascriptRuntimeSemanticsTest, ~24 min) scales directly with this.
2. Cache the compiled JavaAPI. compileJavaAPI() re-ran a ~259-source javac on
every parameterized invocation (hundreds of times); its output depends only
on (jdkVersion, targetVersion). It is now compiled once per combo and copied
into each caller's dir. Coverage-neutral.
3. Parallel surefire forks. forkCount=1C, reuseForks=true. Parallelism is
process-level by necessity: Parser holds static mutable translator state, so
in-JVM thread parallelism would corrupt it; separate forks each run classes
sequentially. Tests use unique temp dirs and the only shared path
(target/benchmark-dependencies) is populated by maven before the test phase
and only read, so forks do not collide. jacoco now writes one exec file per
fork (${surefire.forkNumber}) and merges them before the report so the
ByteCodeTranslator quality/coverage report is unchanged.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 288c8b5 commit df6f60c
3 files changed
Lines changed: 94 additions & 7 deletions
File tree
- vm/tests
- src/test/java/com/codename1/tools/translator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
| |||
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
120 | 157 | | |
121 | 158 | | |
122 | 159 | | |
| |||
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
193 | 216 | | |
194 | 217 | | |
195 | 218 | | |
| |||
385 | 408 | | |
386 | 409 | | |
387 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
388 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
389 | 440 | | |
390 | 441 | | |
391 | 442 | | |
| |||
0 commit comments