Performance Benchmarks — How UIX Delivers Speed
UIX Protocol is infrastructure. When your design tool, CI pipeline, and AI agents all depend on the same schema layer, it needs to be fast. Here's how UIX performs.
Design principles
Performance wasn't bolted on after the fact. Every module in UIX Protocol follows three rules:
- Zero unnecessary allocations. Immutable operations use structural sharing. Hot paths avoid object creation.
- Deterministic pipelines. The runtime's 9-step interpretation pipeline runs the same steps in the same order — no branching, no indirection.
- Stream-friendly. Diff computation, token resolution, and codegen all operate incrementally so they work in real-time collaboration contexts.
The numbers
| Operation | Performance | Context |
|---|---|---|
| Schema validation | <1ms | Full Zod parse of a UIXDocument with 50+ nodes |
| Diff engine | <5ms | Structural diff between two document versions |
| Token resolution | <0.5ms | Resolve nested `{color.primary}` references across a full document |
| Code generation | ~50ms | Generate React + Flutter + SwiftUI for a 50-node document |
| Runtime pipeline | 9 steps | Document × Environment → Interpreted tree, deterministic |
| MCP tool dispatch | <2ms | Route and execute any of 58 MCP tools |
Why these benchmarks matter
Schema validation: <1ms
Every UIXDocument is validated by Zod at runtime. This matters because documents are created, modified, and synced constantly — in Canvas, in CI pipelines, and by AI agents via MCP. Sub-millisecond validation means you get type safety without perceptible latency.
Diff engine: <5ms
computeDocumentDiff() compares two document versions and returns a structured diff — added nodes, removed nodes, modified properties. This runs on every sync cycle and every uix diff command. At <5ms, it's fast enough for real-time collaboration.
Code generation: ~50ms
@uix/codegen generates platform-native code from a UIXDocument. That includes React (.tsx), Flutter (.dart), SwiftUI (.swift), Vue (.vue), Angular (.ts), React Native (.tsx), and HTML (.html). Generating all seven targets from a 50-node document completes in roughly 50ms — fast enough to run in watch mode during development.
Runtime pipeline: 9 deterministic steps
The runtime interprets a UIXDocument through 9 sequential steps:
- Validate environment
- Resolve tokens
- Select variants
- Adapt physics
- Adapt chemistry
- Resolve layout
- Adapt interactions
- Validate bindings
- Resolve animations
Each step is a pure function. The pipeline emits events (step:start, step:complete) and supports strict mode where any error halts the pipeline. In default mode, warnings are collected and the pipeline completes gracefully.
How we maintain performance
- Vitest benchmarks in critical paths — schema validation, diff, token resolution
- No `any` types — strict TypeScript catches type coercion overhead at compile time
- ESM only — tree-shaking eliminates dead code paths in production builds
- Pure functions in @uix/protocol — no classes, no mutable state, no side effects in the foundation package
The takeaway
UIX Protocol processes a full UI schema in under 1ms. It generates code for 7 platforms in ~50ms. It diffs two document versions in <5ms. These aren't theoretical limits — they're the measured performance of the actual codebase running on commodity hardware.
When your schema layer is this fast, it disappears. You stop thinking about performance and start thinking about UI.