mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-25 18:51:35 +00:00
Avoid serializing/reparsing modules during gc
Currently the `wasm-gc-api` crate doesn't expose `parity_wasm::Module` as a public dependency which means that whenever we want to run a GC (which is twice per `wasm-bindgen` invocation) we have to serialize and reparse the module a lot! The `wasm-bindgen` has to serialize, `wasm-gc` then parses, `wasm-gc` then serializes, and `wasm-bindgen` then parses. This commit sidesteps all of these operations by ensuring that we always use the same `parity_wasm::Module` instance, even when multiple versions of the `parity_wasm` crate are in use. We'll get a speed boost when they happen to align (which they always should for `wasm-bindgen`), but it'll work even if they aren't aligned (by going through serialization). Concretely on my machine this takes a `wasm-bindgen` invocation from 0.5s to 0.2s, a nice win!
This commit is contained in:
@ -19,5 +19,5 @@ serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
tempfile = "3.0"
|
||||
wasm-bindgen-shared = { path = "../shared", version = '=0.2.14' }
|
||||
wasm-gc-api = "0.1.8"
|
||||
wasm-gc-api = "0.1.9"
|
||||
wasmi = "0.3"
|
||||
|
Reference in New Issue
Block a user