Repository navigation
perf: upgrade wasmtime to 50 and make call_indirect cheaper in wasm plugins - #1389
Merged
Merged
Conversation
…lugins Initializes function tables when a plugin is instantiated rather than lazily, so call_indirect doesn't check whether its entry was initialized, and turns off the spectre mitigation on table accesses, since plugins have no way to send out what a speculative read could see.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades wasmtime from 49.0.2 to 50.0.0 and makes
call_indirectcheaper for Wasm plugins:table_lazy_init(false)) rather than lazily on first use, socall_indirectno longer checks whether its table entry has been initialized yet. Plugins compiled from managed languages (for example C# with NativeAOT-LLVM) make acall_indirectfor every virtual or interface call, so this check runs constantly.enable_table_access_spectre_mitigation). Plugins only receive file text and return text, with no network or file system access, so there's nowhere for a speculative read past a table to leak to.wasmtime's precompile compatibility hash covers these settings, so cached compiled plugins are recompiled rather than loaded with the old settings.
Measurements
dprint-plugin-prettier (a C# Wasm plugin), one thread, best of three alternating rounds: