Skip to content

Commit

Permalink
Add an optimization to directly wire up imported functions
Browse files Browse the repository at this point in the history
This commit adds an optimization to `wasm-bindgen` to directly import
and invoke other modules' functions from the wasm module, rather than
going through a shim in the imported bindings. This will be an important
optimization in the future for the host bindings proposal, but for now
it's largely just a proof-of-concept to show that we can do it and is
unlikely to bring about many performance benefits.

The implementation in this commit is largely refactoring to reorganize a
bit how functions are imported, but the implementation happens in
`generate_import_function`.

With this commit, 71/287 imports in the `tests/wasm/main.rs` suite get
hooked up directly to the ES modules, no shims needed!
  • Loading branch information
alexcrichton committed Nov 13, 2018
1 parent c85f1b7 commit 68537b9
Show file tree
Hide file tree
Showing 5 changed files with 343 additions and 196 deletions.
Loading

0 comments on commit 68537b9

Please sign in to comment.