Skip to content

perf: load cached wasm plugins in parallel - #1316

Merged
dsherret merged 1 commit into
mainfrom
perf-load-wasm-plugins-in-parallel
Oct 10, 2026
Merged

dsherret merged 1 commit into
mainfrom
perf-load-wasm-plugins-in-parallel

Conversation

@dsherret

Copy link
Copy Markdown
Member

Each cached wasm module was read and deserialized synchronously on the main thread, so plugins loaded one after another. This moves the read and deserialize into spawn_blocking so they overlap across plugins.

  • create_wasm_plugin is now async and does its work on a blocking thread.
  • WasmModuleCreator derives Clone so it can move into the blocking task (it only holds the shared engine).

Measurements

Warm plugin cache, dprint output-resolved-config, median of 25 runs on a 32-core Windows machine, repeated twice with consistent results. "5 plugins" is typescript, json, markdown, toml and dockerfile.

Scenario Before After
5 plugins 57 ms 52 ms
typescript only 50 ms 49 ms

So about 5 ms saved with five plugins and no meaningful change with one.

Reads and deserializes each cached wasm module on a blocking thread instead of one after another on the main thread.
@dsherret
dsherret merged commit 0221190 into main Oct 10, 2026
17 checks passed
@dsherret
dsherret deleted the perf-load-wasm-plugins-in-parallel branch October 10, 2026 18:20
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.

1 participant