Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for automatically executing wasm-opt #625

Merged
merged 2 commits into from
Jul 18, 2019

Commits on Apr 16, 2019

  1. Add support for automatically executing wasm-opt

    This commit adds support for automatically executing the `wasm-opt`
    binary from the [Binaryen project][binaryen]. By default `wasm-pack`
    will now, in release and profiling modes, execute `wasm-opt -O` over the
    final binary. The goal here is to enable optimizations that further
    reduce binary size or improve runtime. In the long run it's expected
    that `wasm-opt`'s optimizations may mostly make their way into LLVM, but
    it's empirically true today that `wasm-opt` plus LLVM is the best
    combination for size and speed today.
    
    A configuration section for `wasm-opt` has been added as [previously
    proposed][fitzgen], namely:
    
    ```toml
    [package.metadata.wasm-pack.profile.release]
    wasm-opt = ['-Os']
    ```
    
    The `wasm-opt` binary is downloaded from Binaryen's [own
    releases](https://github.com/webassembly/binaryen/releases). They're
    available for the same platforms that we download predownloaded binaries
    for `wasm-bindgen` on. We'll also opportunistically use `wasm-opt` in
    `PATH` if it's available. If we're untable to run `wasm-opt`, though, a
    warning diagnostic is printed informing such.
    
    Closes rustwasm#159
    
    [binaryen]: https://github.com/webassembly/binaryen
    [fitzgen]: rustwasm#159 (comment)
    alexcrichton committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    9b74e43 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2019

  1. Configuration menu
    Copy the full SHA
    57bdb3f View commit details
    Browse the repository at this point in the history