Skip to content

Commit dfcb2a7

Browse files
ushironokoclaude
andcommitted
chore: add changeset for @tskm/core compiled fast path (patch)
Bumps @tskm/core to 0.2.1 for the opt-in, experimental compiled validation fast path (safeParseCompiled / getCompiledValidate). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e63aeb5 commit dfcb2a7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.changeset/compiled-fast-path.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@tskm/core": patch
3+
---
4+
5+
Add an opt-in, experimental compiled validation fast path (Tier-0, no eval). `safeParseCompiled` compiles a schema into a closure tree at construction time, with no `eval`, `new Function`, or codegen, so it runs under a strict CSP and on edge runtimes (Cloudflare Workers, Deno Deploy, Vercel Edge) where JIT codegen is blocked.
6+
7+
- It removes the interpreter's megamorphic per-node dispatch and per-value dataset allocation, winning roughly 1.1x to 2.4x on container schemas across both V8 and JSC, while staying byte-identical to `safeParse` on both success and error paths.
8+
- The interpreter stays the single source of truth. Piped, async, and non-specialized nodes fall back to `~run`, and specialization dispatches on factory identity (`schema.reference`), so a foreign schema with a colliding `type` string keeps running its own `~run`.
9+
- New exports are `safeParseCompiled`, `getCompiledValidate`, and the `Cursor` and `Step` types. A bare top-level primitive should keep using `safeParse` directly.

0 commit comments

Comments
 (0)