@holoscript/wasm 6.0.3 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -7
  2. package/package.json +4 -3
package/README.md CHANGED
@@ -4,7 +4,6 @@ High-performance HoloScript parser compiled to WebAssembly.
4
4
 
5
5
  ## Features
6
6
 
7
- - **10x faster parsing** compared to JavaScript implementation
8
7
  - **Browser-native** - runs directly in the browser without server
9
8
  - **Small footprint** - <500KB gzipped
10
9
  - **Full HoloScript support** - all language features including Brittney AI constructs
@@ -137,13 +136,25 @@ npm run test
137
136
 
138
137
  ## Performance
139
138
 
140
- Benchmarks on a typical development machine:
139
+ **The WASM parser is currently SLOWER than the JS parser at canonical
140
+ fixture sizes** due to JS↔linear-memory string marshalling overhead.
141
141
 
142
- | Operation | JavaScript | WASM | Speedup |
143
- | ------------------- | ---------- | ----- | ------- |
144
- | Parse 100 lines | 5ms | 0.5ms | 10x |
145
- | Parse 1000 lines | 50ms | 5ms | 10x |
146
- | Validate 1000 lines | 30ms | 2ms | 15x |
142
+ Measured on i7-11800H / Node v22.20.0 / `wasm-pack` release build
143
+ (`wasm-opt -O3 --enable-bulk-memory --enable-nontrapping-float-to-int`):
144
+
145
+ | Fixture | WASM vs JS speedup |
146
+ | ------------------ | ------------------------ |
147
+ | small (32 lines) | 0.66-0.74x (JS faster) |
148
+ | medium (78 lines) | 0.64-0.67x (JS faster) |
149
+ | large (142 lines) | 0.64-0.66x (JS faster) |
150
+
151
+ Native Rust (no WASM boundary) is ~1.3-1.4x faster than JS, so the
152
+ parser logic itself is competitive — the boundary is the bottleneck.
153
+
154
+ Use WASM only when the V8 JIT is not available (mobile WebViews,
155
+ edge workers, sandboxed runtimes).
156
+
157
+ Full methodology and raw data: `research/2026-04-19_todo-r2-wasm-bench-results.md`.
147
158
 
148
159
  ## Browser Compatibility
149
160
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holoscript/wasm",
3
- "version": "6.0.3",
3
+ "version": "6.1.0",
4
4
  "description": "HoloScript parser compiled to WebAssembly for high-performance browser execution",
5
5
  "main": "pkg/holoscript_wasm.js",
6
6
  "types": "pkg/holoscript_wasm.d.ts",
@@ -28,10 +28,11 @@
28
28
  "url": "https://github.com/brianonbased-dev/HoloScript/issues"
29
29
  },
30
30
  "scripts": {
31
- "build": "echo 'WASM build requires wasm-pack (Rust toolchain) - skipping if not available' && wasm-pack build --target web --out-dir pkg || echo 'wasm-pack not installed, skipping WASM build'",
31
+ "build": "node scripts/build-wasm.mjs",
32
32
  "build:nodejs": "wasm-pack build --target nodejs --out-dir pkg-node",
33
33
  "build:bundler": "wasm-pack build --target bundler --out-dir pkg-bundler",
34
34
  "test": "cargo test || echo 'cargo not installed, skipping WASM tests'",
35
- "clean": "rm -rf pkg pkg-node pkg-bundler target"
35
+ "clean": "rm -rf pkg pkg-node pkg-bundler target",
36
+ "test:coverage": "vitest run --coverage"
36
37
  }
37
38
  }