work / polyglot-bench
Polyglot Checkout Bench
One database-bound checkout transaction built ten ways in TypeScript, Go and Rust, proved identical, then measured with statistics.
- Years
- 2026
- Status
- research
- Source
- hallelx2/polyglot-bench
What it is
Ten implementations of the same pricing and checkout API: six reads, a discount engine with stacking rules and coupons, and an eleven-statement write transaction. Three are TypeScript (Bun with Hono, plain Bun, Node with Fastify), four are Go and three are Rust.
Read more
No stack is timed until the conformance suite proves its responses byte-identical to the others. Then each runs five repetitions of ten seconds after a three-second warm-up, in shuffled order, with the database restored to seed before every run and a machine-speed probe each time.
450 runs, 6.0 million calls, zero non-2xx. At a fixed 300 requests a second every stack's p99 sits between 2.64 ms and 3.60 ms. Saturated, quote throughput spreads from 3,919 to 1,385 requests a second. The write-up is a paper with critical-difference plots, and a dashboard replays the per-second series.
Stack
- TypeScript
- Bun
- Hono
- Node
- Fastify
- Go
- Gin
- Fiber
- Rust
- axum
- actix
- hyper
- PostgreSQL
- Docker
- Python
- LaTeX
Counted
- 450runs
RESULTS.md - 6.0MAPI calls
RESULTS.md, 0 non-2xx - 2.64–3.60 msp99 spread at 300 rps
go-nethttp → ts-bun-hono - 3,919–1,385 rpssaturated quote throughput
rust-axum → ts-node-fastify
How it works
The system as a machine on a bench. Hover or use the arrow keys to drive it.
The path through it
- One specThe API, the discount rules and the transaction, written once in spec/.
- Ten servicesEach stack implements the spec in services/.
- ConformanceEvery response compared; 10 of 10 identical before any timing.
- Load5 × 10 s per stack after a 3 s warm-up, shuffled order, DB restored to seed every run.
- AnalysisCoefficient of variation, significance contrasts, critical-difference plots, the paper and the dashboard.