Katman

Comparison

How Katman compares to oRPC, tRPC, ts-rest, and Hono — features, architecture, and benchmarks.

Feature matrix

FeatureKatmanoRPCtRPCts-rest
End-to-end type-safe I/OYesYesYesYes
End-to-end type-safe errorsYesYesPartialYes
End-to-end type-safe File/BlobYesYesPartialNo
End-to-end type-safe streamingYesYesYesNo
Single package1 package35 packages4+ packages3+ packages
Middleware modelGuard + WrapMiddleware chainMiddleware chain
Compiled pipelineYesNoNoNo
Content negotiationAutomaticRPC protocolNoNo
JSON protocolYesYesYesYes
MessagePack (binary)Built-inVia RPC protocolVia superjson linkNo
devalue (rich types)Built-inNative types via RPCVia superjsonNo
WebSocket RPCYesYesYesNo
Contract-firstYesYesNoYes
Standard Schema (Zod, Valibot, ArkType)YesYesYesNo
OpenAPI generationBuilt-in (Scalar)PluginVia trpc-openapiBuilt-in
SSE / StreamingYesYesYesNo
Server Actions (React)Built-inBuilt-inYesNo
TanStack Query (React)Built-inBuilt-inBuilt-inPartial
TanStack Query (Vue)YesYesNoPartial
TanStack Query (Solid)YesYesNoPartial
TanStack Query (Svelte)YesYesNoNo
AI SDK integrationBuilt-inBuilt-inNoNo
Batch requestsYesYesYesNo
Lazy routingYesYesYesNo
NestJS integrationYesYesPartialYes
Message Port (Electron, Workers)YesYesPartialNo
CF WebSocket HibernationNoYesNoNo
Framework adapters1517+4+2
Built-in plugins1514+

This table is maintained honestly. Where oRPC or tRPC has a feature we don't, it's marked accurately.

Architecture differences

Single package vs 35 packages

Katman ships everything as one npm install katman with subpath imports:

import {  } from "katman"
import {  } from "katman/client"
import {  } from "katman/hono"
import {  } from "katman/otel"

oRPC requires separate installs: @orpc/server, @orpc/client, @orpc/react-query, @orpc/openapi, @orpc/zod, etc. Both approaches work — single package is simpler to manage, monorepo packages allow finer dependency control.

Guard / Wrap vs middleware chain

Most RPC libraries have one middleware type. Katman has two:

  • Guard — runs before, enriches context. No next(). Sync fast-path.
  • Wrap — runs before AND after (onion). Has next(). For timing, caching, error capture.
oRPC:    middleware → middleware → middleware → handler
Katman:  guard → guard → guard → [wrap → [wrap → handler]]

Guards are semantically clearer and faster (no async overhead when sync). oRPC's single middleware is more flexible.

Compiled pipeline vs runtime dispatch

Katman compiles the middleware chain once at startup:

  • Guards are unrolled (0-4 specialization, no loop)
  • Context pool eliminates per-request allocation
  • Handler analysis skips unused features

oRPC evaluates the chain at runtime per request. More flexible for dynamic middleware, but Katman is faster for static pipelines.

Content negotiation vs RPC protocol

Katman inspects Accept header and responds in the matching format (JSON, MessagePack, or devalue). Standard HTTP, works with any client.

oRPC uses its own RPC protocol that natively handles Date, File, Blob, BigInt without negotiation. Simpler for oRPC-to-oRPC, less interoperable with non-oRPC consumers.

tRPC uses JSON by default, SuperJSON via transformer for rich types.

Benchmarks

All benchmarks run on the same machine (Apple M3 Max, Node v24.11.0). Sequential requests to isolate per-request latency.

Pipeline performance (no HTTP, pure execution)

Measures raw middleware pipeline overhead — how fast the framework processes a call after TCP/HTTP is stripped away.

ScenarioKatmanoRPCH3 v2vs oRPCvs H3
No middleware111 ns685 ns2,025 ns6.2x faster18.2x faster
Zod input validation241 ns804 ns4,214 ns3.3x faster17.5x faster
3 middleware + Zod297 ns1,718 ns3,954 ns5.8x faster13.3x faster
5 middleware + Zod413 ns2,219 ns3,917 ns5.4x faster9.5x faster

Katman's compiled pipeline (unrolled guards, context pool) is 3-6x faster than oRPC and 9-18x faster than H3 at the pipeline level.

HTTP performance (Katman vs oRPC vs H3 vs Hono)

Real HTTP servers, real TCP connections, 3000 sequential requests per scenario.

ScenarioKatmanoRPCH3 v2Hono
Simple (no middleware)79µs (12,592/s)83µs (12,048/s)78µs (12,753/s)74µs (13,516/s)
Zod validation86µs (11,627/s)120µs (8,315/s)93µs (10,707/s)97µs (10,280/s)
Guard + Zod79µs (12,706/s)116µs (8,625/s)96µs (10,359/s)102µs (9,799/s)
ComparisonSimpleZodGuard + Zod
Katman vs oRPC~tied1.4x faster1.5x faster
Katman vs H3~tied1.1x faster1.2x faster
Katman vs Hono0.9x1.1x faster1.3x faster

For simple routes, all four are within 10% — TCP overhead dominates. As middleware complexity grows, Katman's compiled pipeline pulls ahead: 1.5x faster than oRPC and 1.2-1.3x faster than H3/Hono with guards + validation.

Katman serve() vs Nitro v3 (real server)

Real Nitro dev server process vs Katman serve(), 2000 requests.

ScenarioKatman serve()Nitro v3 (real)
Health (no middleware)102µs / 9,781 req/s238µs / 4,208 req/s2.3x faster
List + Zod validation108µs / 9,250 req/s231µs / 4,322 req/s2.1x faster
Guard + Zod validation108µs / 9,268 req/s223µs / 4,484 req/s2.1x faster

Nitro adds srvx abstraction, H3 middleware chain, and Node→Fetch conversion per request. Production builds would be faster, but the H3/srvx layer remains.

Tail latency (p99)

Scenario (Guard + Zod)avgp50p99
Katman79µs70µs148µs
oRPC116µs103µs223µs
H3 v296µs82µs236µs
Hono102µs87µs194µs

Katman's p99 is 34% lower than oRPC and 37% lower than H3 — compiled pipelines keep tail latency predictable.

Memory usage

50K calls, 3 guards + Zod validation, measured with --expose-gc

FrameworkBytes per callRatio
Katman~40 bytes1x
oRPC~56 bytes1.4x more

WebSocket performance

2000 sequential messages over persistent connection

ScenarioKatmanoRPCH3 v2
Simple query39µs42µs34µs

WebSocket eliminates TCP handshake overhead. All three are close — H3 is slightly faster here.

What the benchmarks don't show

  • Real-world APIs spend 95%+ of time in DB queries and business logic. Pipeline overhead matters most for high-throughput, low-latency services.
  • Nitro production would be faster than dev mode (watcher/HMR overhead removed).
  • All benchmarks are sequential (1 connection). Concurrent load may show different characteristics.

Reproduce on your hardware:

node --experimental-strip-types bench/vs-all.ts     # Katman vs oRPC vs H3 vs Hono
node --experimental-strip-types bench/vs-nitro.ts   # vs real Nitro server
node --experimental-strip-types bench/pipeline.ts   # pipeline only (no HTTP)

Where oRPC is ahead

Being honest about oRPC's strengths:

  • Ecosystem breadth — 35 packages with more niche integrations (React SWR, Vue Pinia Colada, Hey API, Sentry)
  • Cloudflare Durable Objects — Hibernation + Durable Iterator support
  • RPC protocol — Native type serialization without header negotiation
  • Community size — Larger user base means more battle-tested edge cases
  • Angular support — TanStack Query for Angular

Where Katman is ahead

  • Single package — one install, no version coordination
  • Compiled pipeline — measurably faster, lower p99 latency
  • Guard / Wrap model — clearer separation of concerns
  • Content negotiation — standard HTTP, interoperable with any client
  • Built-in Scalarscalar: true in serve() for API docs
  • HTTP/2 support — one-flag TLS setup
  • Auto port selection — no EADDRINUSE handling needed

When to choose what

You needChoose
Simplest setup (1 install, everything works)Katman
Largest ecosystem, niche integrationsoRPC
Migrate from tRPCKatman (fromTRPC()) or oRPC (toORPCRouter())
Contract-first with OpenAPIKatman, oRPC, or ts-rest
Cloudflare Durable ObjectsoRPC
Lowest per-request latencyKatman
Already using Hono as your frameworkHono native

What's next?

On this page