# WASM / WASI Preview 2 Component Model + JSPI Perf-Budget and Link-Rule Planner

Plan a WebAssembly component deployment: wac-style link graph and plug commands, WASI Preview 2 support across five runtimes, JSPI flags, and size / cold-start / TTFB / memory budgets.

> Canonical page: https://elysiatools.com/en/tools/wasm-wasi-component-model-jspi-wasi-copilot-perf-budget-and-link-rule-planner

- **Category:** Validation

- **Keywords:** wasm, wasi, component model, wit, wac, wasmtime, cold start, ttfb, jspi, link rules

## Overview

Components parse into a wac-style socket/plug link graph with topological ordering, cycle detection and generated wac plug / wac targets commands; the support matrix encodes stable WASI 0.2 (wasi-cli, wasi:http/proxy) versus proposals (keyvalue, config) across wasmtime, Wasmer, WasmEdge, WAMR and V8; size, cold-start p50/p95/p99, streaming TTFB and per-instance memory are modeled against your budgets; JSPI is flagged V8-native but not W3C-standardized.

## Inputs

- **Component manifest** (textarea): One per line: name, imports, exports, size_kb (use "-" for empty lists) e.g. api-gateway, wasi:http/incoming-handler@0.2.0 wasi:keyvalue/store@0.1.0, wasi:http/outgoing-handler@0.2.0, 850 auth-plug, -, wasi:http/incoming-handler@0.2.0, 220 kv-cache, -, wasi:keyvalue/store@0.1.0, 150
- **Target runtimes** (select)
- **Required WASI interfaces** (select)
- **Uses JSPI (async↔sync bridge)** (checkbox)
- **Streaming responses (wasi:http)** (checkbox)
- **Expected concurrent instances** (number)
- **Linear memory per instance (MB)** (number)
- **Size budget (KB)** (number)
- **Cold-start budget p99 (ms)** (number)
- **TTFB budget (ms)** (number)

## When to use

- Composing modular WebAssembly components using socket/plug linkage rules and wac CLI commands.
- Evaluating runtime interface compatibility across Wasmtime, Wasmer, WasmEdge, WAMR, and V8 isolates for WASI 0.2 worlds.
- Sizing multi-instance memory limits and validating cold-start p99 or streaming TTFB budgets against runtime overheads.

## How it works

- Define components in the manifest with their imports, exports, and individual binary sizes in kilobytes.
- Select targeted runtimes such as Wasmtime, Wasmer, or V8 alongside required interfaces like wasi:http/proxy or wasi:keyvalue.
- Toggle JSPI flags or streaming response settings and set concurrent instance counts and memory limits.
- Review the generated topological link graph, concrete wac plug commands, runtime compatibility warnings, and latency/memory budget evaluations.

## Use cases

- Architecting micro-edge services composed of modular authentication, routing, and caching components.
- Validating strict sub-millisecond cold-start and memory limits for embedded systems using WAMR AOT compilation.
- Planning Node.js or browser isolate deployments relying on V8 and JSPI bridges for asynchronous I/O.

## Frequently asked questions

### What does the planner's link graph analyze?

It builds a directed acyclic graph of component imports and exports, validates topological ordering, detects circular dependencies, and generates wac plug commands.

### Which WebAssembly runtimes are supported in the matrix?

The planner evaluates feature parity and performance across Wasmtime (Cranelift), Wasmer, WasmEdge, WAMR (micro/AOT), and V8 isolates.

### How does JSPI impact deployment planning?

JavaScript Promise Integration (JSPI) enables synchronous-to-asynchronous bridge execution in V8 isolates, but it is flagged as not yet standardized across non-V8 runtimes.

### How is streaming TTFB calculated differently from buffered responses?

When streaming responses are enabled, TTFB models initial chunk arrival rather than buffering the full payload, drastically reducing p95/p99 time-to-first-byte.

### What is the difference between stable WASI 0.2 and Phase 2 proposals?

Stable interfaces like wasi:cli and wasi:http/proxy enjoy broader runtime support, whereas proposals like wasi:keyvalue and wasi:config may require custom host implementations.

## Related tools

- [US Municipal Code Citation Link Checker & Renumbering Detector (Municode / American Legal / eCode360)](https://elysiatools.com/en/tools/us-state-county-municode-code-of-ordinances-section-subsection-citation-link-checker): Parse Title/Chapter/Article/Section/Subsection/Appendix municipal code citations, generate Bluebook Rule 12.9.2 legal citations, detect renumbering after recent ordinances (gaps, duplicates, out-of-order sections), and optionally live-verify hosted deep links.
- [Mod-11 Checksum Calculator](https://elysiatools.com/en/tools/mod11-checksum): Validate or generate numbers using the Modulus-11 (ISO 7064) check-digit algorithm with ISBN-10 (10..2), Norwegian-ID (3,7,6,1,8,9,4,5,2) and generic 2-7 weight schemes.
- [AI Domain Name Idea Generator](https://elysiatools.com/en/tools/ai-domain-name-idea-generator): Generate up to 10 creative domain names with AI and filter out already-registered ones via DNS + RDAP.
- [Cron Expression Explainer](https://elysiatools.com/en/tools/cron-expression-explainer): Parse a 5-part / 6-part / Quartz cron expression into a plain-language schedule description, show the field-by-field breakdown, and list the next N execution times in any IANA timezone — with an AI-generated natural-language explanation in your language
- [Kanban Cycle Time & Throughput Coach](https://elysiatools.com/en/tools/kanban-cycle-time-throughput-coach): Import created→started→resolved timestamps from CSV (Jira-style or simple) and get flow metrics the way agile coaches read them: lead/cycle time percentiles, WIP age, throughput per day/week/month, a cumulative flow diagram and a Little's Law consistency check.
- [ML-KEM / Kyber Keypair & Encapsulation Tester](https://elysiatools.com/en/tools/ml-kem-kyber-keypair-and-encapsulation-tester): Generate ML-KEM-512/768/1024 (FIPS 203 / CRYSTALS-Kyber) keypairs, encapsulate a random shared secret against the public key, decapsulate it with the private key, and verify both sides match — with the exact wire sizes of all three parameter sets checked live against the standard.
- [PKCE Code Verifier & Challenge Generator](https://elysiatools.com/en/tools/pkce-code-verifier-generator): Generate, validate and verify OAuth2 / OIDC PKCE (RFC 7636) code_verifier and S256 code_challenge pairs. Three modes: (1) generate a fresh verifier + challenge from cryptographically secure random bytes at 256/384/512/768-bit entropy, (2) audit a verifier you already have against the RFC — length (43–128), charset \[A-Za-z0-9-._~\] and ≥256-bit entropy, and (3) verify a verifier/challenge pair by recomputing BASE64URL(SHA256(verifier)). Optionally build the full authorization-request URL and token-exchange body. Complements the generic nonce-generator (which only emits a verifier+challenge pair) with RFC-compliance auditing and pair verification.
- [Security Headers Checker](https://elysiatools.com/en/tools/security-headers-checker): Audit HTTP response headers for security compliance — parses the raw headers you paste (no network) and grades them against the OWASP secure-header set with value-level checks: HSTS max-age, CSP unsafe-inline/eval, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP/COEP/CORP and more. Outputs a letter grade (A+ to F) plus per-header findings with copy-ready fix recommendations.

## Samples

- [WebAssembly (WASM) High-Performance Computing](https://elysiatools.com/en/samples/webassembly): WebAssembly for browser-based high-performance computing and near-native speed
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [WASM Viewer Samples](https://elysiatools.com/en/samples/wasm-viewer-samples): A WASM sample for in-browser preview
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
