Skip to content
  • Liam Aharon's avatar
    Small optimisation to `--profile dev` wasm builds (#1851) · ff3a3bca
    Liam Aharon authored
    `wasm-builder` was adjusted to default to building wasm blobs in
    `release` mode even when cargo is in `debug` because `debug` wasm is too
    slow.
    
    A side effect of this was `.compact` and `.compact.compressed` getting
    built when the dev is running build in `debug`, adding ~5s to the build
    time of every wasm runtime.
    
    I think it's reasonable to assume if the dev is running `debug` build
    they want to optimise speed and do not care about the size of the wasm
    binary. Compacting a blob has negligible impact on its actual
    performance.
    
    In this PR, I adjusted the behavior of the wasm builder so it does not
    produce `.compact` or `.compact.compressed` wasm when the user is
    running in `debug`. The builder will continue to produce the bloaty wasm
    in release mode unless it is overriden with an env var.
    
    As suggested by @koute in review, also refactored the
    `maybe_compact_wasm_and_copy_blobs` into multiple funuctions, and
    renamed things to better support RISC-V in the future.
    
    ---
    
    There is no `T-runtime` label so @KiChjang
    
     told me to put `T1-FRAME` :)
    
    ---------
    
    Co-authored-by: default avatarKoute <[email protected]>
    ff3a3bca