fuz_schema
a performance-focused
schema library for JS
fuz_schema takes Valibot's approach, with a tree-shakeable function per schema and pipe for refinement, and pushes it further on bundle size, speed, and memory,
with simpler internals. It's published as @fuzdev/fuz_schema and is pre-1.0; feedback is welcome in the issues and discussions.
For now this site has only benchmarks and the generated API reference docs. For usage docs, see the README.
about · docs · benchmarks · source
Measured
Against Valibot, Zod, Zod compiled, Zod Mini, TypeBox, Valita, Sury, from one run on laptop1 on 2026-11-23. fuz_schema compiled is fuz_schema in another mode, and not another library. Each heading links to the rows behind its figure, and the benchmarks page says how each was measured.
- fuz_schema compiled: It carries the compiler of
compile.ts, and compiles while the schema is built. - Zod compiled: It carries the compiler
z.compileneeds, and compiles while the schema is built. - Sury: It carries its compiler, and compiles while the schema is built.
- fuz_schema: A strict or identity parse of valid input returns the input itself, where Valibot and Zod return a copy.
- fuz_schema compiled: Each schema through
compile_parse, whose compiled code builds whatparsereturns for a valid input: the input itself where nothing changed. - Zod: Classic
zodgenerates a parser for each object schema on its first parse where the environment allows eval. - Zod compiled: Each root through
z.compile, which generates its parser and its validator ahead of time. A root it hands back uncompiled has no timed figure. - Zod Mini: Its objects never compile:
zod/minihas no generated parser. - TypeBox: Every row is a
Checkof its compiled validator, which stops at the first failure and builds no issues and no output. - Valita: As this library does, it hands back a valid input that needs no change, and builds no copy of it.
- Sury: Each row is an operation it generates with
new Function,parseAsResultfor a parse andisInputfor a guard, compiled as the schema is built. A parse of valid input returns a new object with every key of its schema, an optional key the input lacks among them, with no value.
- fuz_schema compiled: Compiled code builds no issue: an invalid input is handed to
parse, so a figure is the interpreter's parse after the compiled code has run to its first failure. - Zod: Classic
zodgenerates a parser for each object schema on its first parse where the environment allows eval. - Zod compiled: Each root through
z.compile, which hands an invalid input to Zod's regular parser. A root it hands back uncompiled has no timed figure. - Zod Mini: Its objects never compile:
zod/minihas no generated parser. - TypeBox: Every row is a
Checkof its compiled validator, which stops at the first failure and builds no issues and no output. - Sury: Each row is an operation it generates with
new Function,parseAsResultfor a parse andisInputfor a guard, compiled as the schema is built.
- fuz_schema compiled: Each schema through
compile_guard, which gives whatisgives. - Valibot: Its guard,
is, runs the parser, which copies what it reads, and drops the copy. - Zod: Its guard,
z.validate, runs the parser where a schema has no compiled path, which copies what it reads, and drops the copy. - Zod compiled: Each root through
z.compile, which generates its parser and its validator ahead of time. A root it hands back uncompiled has no timed figure. - Zod Mini: Its guard,
z.validate, runs the parser where a schema has no compiled path, which copies what it reads, and drops the copy. - TypeBox: Every row is a
Checkof its compiled validator, which stops at the first failure and builds no issues and no output. - Valita: It has no guard of its own: its row is its parse.
- Sury: Each row is an operation it generates with
new Function,parseAsResultfor a parse andisInputfor a guard, compiled as the schema is built.
- fuz_schema compiled: It carries the compiler of
compile.ts, and compiles while the schema is built. - Zod: Classic
zodgenerates a parser for each object schema on its first parse where the environment allows eval. - Zod compiled: It carries the compiler
z.compileneeds, and compiles while the schema is built. - Sury: It carries its compiler, and compiles while the schema is built.
- fuz_schema compiled: It carries the compiler of
compile.ts, and compiles while the schema is built. - Zod compiled: It carries the compiler
z.compileneeds, and compiles while the schema is built. - Sury: It carries its compiler, and compiles while the schema is built.
- fuz_schema compiled: It carries the compiler of
compile.ts, and compiles while the schema is built. - Zod compiled: It carries the compiler
z.compileneeds, and compiles while the schema is built. - Sury: It carries its compiler, and compiles while the schema is built.