You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support optimizing feature checks at compile time (#1733)
* Support optimizing feature checks at compile time
Something I've long wanted for `wasmparser` is the ability to
constant-propagate decisions about feature selection instead of
requiring runtime checks to do so. This should be a performance win for
proposals as they become standardized and more and more of wasm is gated
behind some feature or another. The goal with this is to enable a mode
of `wasmparser` which doesn't require runtime checks of booleans/bits to
see whether a proposal is enabled or not.
In lieu of not redesigning everything too much (e.g. adding `F:
WasmFeatures` everywhere) this commit adds a new compile time Cargo
feature to the crate called `features` which, when disabled, makes
`WasmFeatures` a zero-sized type that represent the default active
features for `wasmparser`. This enables const-propagating decisions
about features throughout the codebase and should help optimize the
validator/decoder in niche situations.
* Add required feature
* Update crates/wasmparser/src/features.rs
Co-authored-by: Nick Fitzgerald <[email protected]>
---------
Co-authored-by: Nick Fitzgerald <[email protected]>
0 commit comments