Implement startup batching: 12x faster boot

Batch-compile all ~64 IR primitives into a single WASM module at startup.
Replaces 64 separate Module::new + Instance::new with 1 of each.
Reuses compile_consolidated_module() directly, removed compile_core_module() stub.

Boot time: 7.7ms -> 0.6ms (release), test suite: 5.1s -> 1.5s (debug).
13 of 14 optimizations now implemented. 392 tests passing.
This commit is contained in:
2026-04-02 13:05:53 +02:00
parent 8c53afa28a
commit f7a8bf1d24
3 changed files with 72 additions and 22 deletions
-10
View File
@@ -1877,16 +1877,6 @@ pub fn compile_consolidated_module(
Ok(bytes)
}
/// Generate the core/bootstrap WASM module.
///
/// Not yet implemented -- will be built in a future step.
pub fn compile_core_module(primitives: &[(String, Vec<IrOp>)]) -> WaferResult<Vec<u8>> {
let _ = primitives;
Err(WaferError::CodegenError(
"compile_core_module not yet implemented".to_string(),
))
}
// ---------------------------------------------------------------------------
// Tests
// ---------------------------------------------------------------------------