Skip to content

improve WasmConfig initialization for performance and memory ef…#147

Merged
ruslanti merged 1 commit into
mainfrom
ref/wasmtime_engine_config
Jun 10, 2026
Merged

improve WasmConfig initialization for performance and memory ef…#147
ruslanti merged 1 commit into
mainfrom
ref/wasmtime_engine_config

Conversation

@ruslanti

Copy link
Copy Markdown
Collaborator

…ficiency

@ruslanti ruslanti self-assigned this Jun 10, 2026
@ruslanti ruslanti added the enhancement New feature or request label Jun 10, 2026
Copilot AI review requested due to automatic review settings June 10, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors WasmConfig initialization to simplify configuration and tune Wasmtime engine defaults toward faster execution/instantiation and lower allocator footprint.

Changes:

  • Removed the custom WasmConfigBuilder path and consolidated configuration into WasmConfig::default().
  • Updated Wasmtime engine defaults (Cranelift opt level, backtrace settings, memory_init_cow).
  • Adjusted pooling allocator “warm slot” behavior (reduced from 10 to 1).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/runtime/src/lib.rs
Comment on lines +240 to 244
// Debug build: keep full, symbolized guest backtraces. We are optimizing
// execution CPU, not trap-path cost, and this is the standalone debug
// runner — detailed backtraces are the whole point.
inner.wasm_backtrace(true);
inner.wasm_backtrace_details(WasmBacktraceDetails::Enable);
Comment thread crates/runtime/src/lib.rs
Comment on lines +277 to +279
// No concurrency: at most one instance is ever live, so don't keep extra
// slots warm (was 10, tuned for a multi-tenant server).
pooling_allocation_config.max_unused_warm_slots(1);
@ruslanti ruslanti requested a review from qrdl June 10, 2026 10:31
@ruslanti ruslanti merged commit 242cd96 into main Jun 10, 2026
5 of 7 checks passed
@ruslanti ruslanti deleted the ref/wasmtime_engine_config branch June 10, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants