Skip to content

Optimize cranelift-codegen in dev profile for faster E2E tests#736

Merged
gfx merged 1 commit intomainfrom
claude/optimize-e2e-tests-X6251
Mar 30, 2026
Merged

Optimize cranelift-codegen in dev profile for faster E2E tests#736
gfx merged 1 commit intomainfrom
claude/optimize-e2e-tests-X6251

Conversation

@gfx
Copy link
Copy Markdown
Member

@gfx gfx commented Mar 30, 2026

Summary

  • Set opt-level = 2 for cranelift-codegen in the dev profile to speed up E2E tests
  • Cranelift compiles Wasm→native for every test; without optimization it runs in debug mode, accounting for ~70% of test time
  • O0 test suite: 319s → 246s (~23% faster)

Profiling details

Profiled the O0 E2E test suite (877 tests) and found:

Phase Time per test Share
Wado compile (Wado→Wasm) ~0.17s ~30%
Wasmtime runtime (Cranelift + instantiate + run) ~0.40s ~70%
  • stdlib parsing is already cached via OnceLock — not a bottleneck
  • Linker caching was tested but had no effect (Linker::clone()add_to_linker cost)
  • Other wasmtime crates at O2 provided no additional improvement beyond cranelift-codegen alone
  • Build time increases by ~16s (one-time cost, amortized across test runs)

Test plan

  • Full O0 test suite passes (862 passed, 15 pre-existing failures)
  • Verified no behavior change — same pass/fail results as before
  • Build time impact measured (~16s increase)

https://claude.ai/code/session_01MvCfQRXKLDn386HwGHfSQM

Cranelift compiles Wasm to native code for every E2E test. Without
optimization, this runs in debug mode and accounts for ~70% of test
time. Setting opt-level=2 for cranelift-codegen reduces O0 test suite
time from 319s to 246s (~23% faster).

https://claude.ai/code/session_01MvCfQRXKLDn386HwGHfSQM
@gfx gfx enabled auto-merge March 30, 2026 13:14
@gfx gfx merged commit 89206bc into main Mar 30, 2026
10 checks passed
@gfx gfx deleted the claude/optimize-e2e-tests-X6251 branch March 30, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants