-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
47 lines (43 loc) · 1.99 KB
/
Copy pathCargo.toml
File metadata and controls
47 lines (43 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[package]
name = "jsonstat-wasm"
version = "0.4.1"
edition = "2021"
description = "A fast JSON-stat 2.0 parser compiled to WebAssembly"
repository = "https://github.com/jsonstat/wasm"
license = "MIT"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
wasm-bindgen = "0.2.125"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
console_error_panic_hook = "0.1.7"
serde-wasm-bindgen = "0.6.5"
js-sys = "0.3.102"
# Preserves insertion order for the `dimension` map so ToJSON() emits
# dimensions in the same order as the source document. Already resolved
# transitively via serde_json's `preserve_order` feature; declared directly
# here to use IndexMap in our own model types.
indexmap = { version = "2", features = ["serde"] }
# Release profile tuned for WebAssembly SPEED (was size-first in ≤0.1.x).
# For a parsing/query library, runtime throughput matters more than a few KB of
# binary size, so we trade a slightly larger `.wasm` for faster code:
# - `opt-level = 3` → full speed optimizations (replaces size-first "s").
# - `lto = "fat"` → cross-crate link-time optimization (slower build,
# better runtime) — stronger than the plain `true`.
# - `codegen-units = 1` → whole-crate single-unit codegen (best inlining).
# - `panic = "abort"` + `strip` → trim panic machinery & symbols.
# wasm-pack still runs `wasm-opt` on top of this (see below).
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
# wasm-opt settings for `wasm-pack build --release`. `-O4` is the strongest
# speed-focused preset (replaces the balanced `-O`); current rustc emits the
# `bulk-memory` and `nontrapping-float-to-int` WASM features by default, which
# older bundled `wasm-opt` versions reject unless explicitly enabled, so we
# enable them here to keep `wasm-opt` running.
[package.metadata.wasm-pack.profile.release]
wasm-opt = ['-O4', '--enable-bulk-memory', '--enable-nontrapping-float-to-int']