Shrink binary size of distributed wasm-bindgen

This shaves a little over 2MB off the download locally for Linux,
removing debuginfo (which no one's probably gonna use anyway) as well as
switching from jemalloc to the system allocator.
This commit is contained in:
Alex Crichton
2018-10-17 19:15:09 -07:00
parent ab8be88e7b
commit cb9c9fb011
4 changed files with 18 additions and 1 deletions

View File

@ -36,6 +36,10 @@ use failure::{Error, ResultExt};
use parity_wasm::elements::{Deserialize, Module, Section};
use wasm_bindgen_cli_support::Bindgen;
// no need for jemalloc bloat in this binary (and we don't need speed)
#[global_allocator]
static ALLOC: std::alloc::System = std::alloc::System;
mod headless;
mod node;
mod server;

View File

@ -13,6 +13,10 @@ use docopt::Docopt;
use failure::Error;
use wasm_bindgen_cli_support::Bindgen;
// no need for jemalloc bloat in this binary (and we don't need speed)
#[global_allocator]
static ALLOC: std::alloc::System = std::alloc::System;
const USAGE: &'static str = "
Generating JS bindings for a wasm file

View File

@ -11,6 +11,10 @@ use std::process;
use docopt::Docopt;
use failure::{Error, ResultExt};
// no need for jemalloc bloat in this binary (and we don't need speed)
#[global_allocator]
static ALLOC: std::alloc::System = std::alloc::System;
const USAGE: &'static str = "
Converts a wasm file to an ES6 JS module