From 2f815e277d8cb6e603a29551f03bc59982672f21 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 18 Jun 2020 09:37:44 +0800 Subject: [PATCH] Add wasm-bindgen to instant crate for wasm. --- Cargo.toml | 2 +- README.md | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6ced850a..1f38d142 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,4 +65,4 @@ features = ["compile-time-rng"] optional = true [target.'cfg(target_arch = "wasm32")'.dependencies] -instant= "0.1.4" # WASM implementation of std::time::Instant +instant= { version = "0.1.4", features = ["wasm-bindgen"] } # WASM implementation of std::time::Instant diff --git a/README.md b/README.md index cc1411a9..d79c1218 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,9 @@ to add scripting to any application. Supported targets ----------------- -* All common targets, including [WASM] and `no-std`. +* All common CPU targets for Windows, Linux and MacOS. +* [WASM] +* `no-std` Features -------- @@ -185,9 +187,11 @@ When building for WASM, certain features will not be available, such as the scri from external script files. Also look into [minimal builds] to reduce generated WASM size. As of this version, a typical, full-featured -Rhai scripting engine compiles to a single WASM file around 200KB gzipped. When excluding features that are +Rhai scripting engine compiles to a single WASM file less than 200KB gzipped. When excluding features that are marginal in WASM environment, the gzipped payload can be further shrunk to 160KB. +In benchmark tests, a WASM build runs scripts roughly 1.7-2.2x slower than a native optimized release build. + Related Resources -----------------