01 · CLI shim
rjest binary
A thin Rust CLI. It opens a Unix domain socket to jestd, forwards your args, streams results back, and renders Jest-style output. If the daemon is not running, it boots one.
Architecture
Every rjest run is a request to a long-lived daemon. Understanding the five stages below explains exactly where the warm-run speedup comes from — and why cold start is honestly a little slower.
rjest --watch you type this │ nng / Unix domain socket (sub-ms) ▼ ┌──────────────────────────────────────────┐ │ jestd (persistent Rust daemon) │ │ ├─ parsed jest.config (in memory) │ │ ├─ dependency graph (in memory) │ │ ├─ FS watcher (live) │ │ ├─ SWC transforms ──▶ sled cache (blake3) │ │ └─ worker pool ──▶ warm Node.js VMs │ └──────────────────────────────────────────┘ │ ▼ PASS src/*.test.ts rendered Jest-style
01 · CLI shim
A thin Rust CLI. It opens a Unix domain socket to jestd, forwards your args, streams results back, and renders Jest-style output. If the daemon is not running, it boots one.
02 · Transport
nanomsg-next-gen over a Unix domain socket. Sub-millisecond round-trip between the CLI and the daemon — the request/response cost is effectively free.
03 · Daemon
Holds the parsed Jest config, the file-system watcher, the module dependency graph, and the worker pool. It is the thing that survives between invocations.
04 · Transforms
TypeScript and JSX compiled natively by SWC. Output cached in sled on disk, keyed by blake3 content hash. A file only re-transforms when its bytes change.
05 · Workers
Persistent Node processes execute test files in isolated VM contexts. V8 warmup and JIT are amortized across runs instead of paid per invocation.
The first invocation in a session has to boot the daemon, spin up workers, and warm V8. That is why the repo benchmark shows rjest at ~1.9s cold versus Jest's ~1.4s. You pay it once. Every subsequent run reuses the warm daemon and lands in milliseconds. Most of CI and all of local watch-mode development live in the warm path — which is exactly what rjest optimizes.
Transform output is content-addressed. When you restart jestd (or reboot), the sled store on disk is still valid because a blake3 hash of the source bytes maps deterministically to the compiled result. A cold restart therefore skips re-transforming anything that has not changed.
Read the guides for practical setup, or the deep dive on where Jest's time actually goes.