Makepad's Relax runs Rust from source under a JIT, no rustc
Relax is a live compiler and JIT runtime for Rust, written in Rust, published by the Makepad project under the tagline "Rust without the wait." The idea: rustc builds your program and then you run it, whereas Relax runs your program while it builds it. It runs a Cargo package straight from source with no rustc, LLVM or linker in the loop. It compiles each function when it is first called, optimises the hot ones while the program runs, and patches your edits into the running process. Relax replaces rustc and LLVM, plus the parts of Cargo and the linker in between, with one Rust library.
Code generation exists for x86-64 and AArch64. From a fresh clone the repository builds and its tests pass on Linux x86-64 and macOS arm64; Windows is not tested. Building Relax needs a stable Rust toolchain and nothing from crates.io, and the project is MIT-licensed. On the authors' machines, building relax took 53 s on a 16-core x86-64 Linux box and 78 s on a 10-core arm64 Mac, with cargo held to 4 jobs. The first relax run of a fresh hello package took 0.24 s and 0.97 s respectively, and later runs took 0.01 to 0.07 s. Compiled code is kept in the package's target/relax (120 to 190 MB for hello), so each new package starts cold.
The page is blunt about the trade-offs. The code Relax runs is slower than rustc's --release: across 21 workloads, the geomean is 1.12 times rustc's time on x64 and 1.24 times on arm64 against a stock (generic-CPU) build, and 1.22 times and 1.25 times against a native-CPU build (-C target-cpu=native). Because Relax always compiles for the CPU it runs on, the native column is the like-for-like one. Relax is faster on only a few workloads. Against stock it wins on x64 for rigid-body physics (0.43 times), game simulation tick (0.60 times) and level walk (0.87 times), and on arm64 for the LLM decode host path (0.87 times) and level walk (0.91 times). Against the native build the two big x64 wins disappear (rigid-body physics 1.38 times, game simulation tick 1.26 times), since they were wins over a generic-CPU baseline. The worst workload, a 3D model build, takes about twice rustc's time. A separate set of 30 kernel micro-benchmarks gives a steady-state geomean of 1.14 times against stock and 1.24 times against native on x64, and about 1.23 times on arm64. Those figures are provisional upper bounds because of a warm-cache tier-up bug: with a warm JIT cache some hot functions never tier up to O3. The 21-workload table is not affected. All figures are the median of 3 rounds measured on 2026-11-12, on an 8-core desktop CPU under Linux and an Apple M4 laptop under macOS, against rustc 1.99.1 and LLVM 23.1.1.
On where the gap comes from, an instruction-level comparison of the same functions in one 3D-print slicer run shows extra instructions rather than stalls: 1.26 times the instructions cost 1.15 times the cycles. Inlining is not a cause, since Relax inlines more than rustc does.
Other limits are listed up front. Relax uses more memory, because the compiler, its caches and every published code version share the program's process and JIT code is append-only. relax check is not yet faster than cargo check: on a large package a cold check takes longer and uses more memory, and an edit can re-check more than it needs to; the authors say they are working on it. Not every crate runs yet, and libs/relax/KNOWN_GAPS.md lists the open gaps, each with a repro. Not every edit patches live: function bodies do, but a changed struct layout, import, trait or impl header, or macro waits for a restart, which Relax offers. The borrow checker runs in the background beside the program, while each function is type-checked before it runs; relax run --check-first waits for the borrow checker instead. Relax is not a release build: the page says to ship what cargo build --release builds.
The page ties the project to AI-agent workflows. "An AI agent can't feel a slow build, but it pays for every one in tokens, wall-clock and lost context." Makepad builds its apps with many AI agents working in parallel, and its dev hub, devhub, keeps each agent's app or test run alive under Relax on a warm machine. In practice nine agent lanes run side by side, devhub handles more than 300 build and test jobs an hour, and dozens of changes land every day, each checked under Relax before it merges. Across a day of those lanes, an edit was patched 3.6 s (median) after it reached the machine, and 86 s at p90 on a cold JIT or cache.
Relax also exposes inspection commands: relax run prints a relax-remote pid line, and relax inspect
Key facts
- Relax runs a Cargo package from source with no rustc, LLVM or linker: it compiles each function on first call, optimises hot ones while running, and patches edits into the live process.
- Its code is slower than rustc --release: geomean 1.12 times the time on x64 and 1.24 times on arm64 over 21 workloads (1.22 times and 1.25 times against a native-CPU build); the worst workload takes about twice rustc's time.
- It wins on only a few workloads against stock rustc, such as x64 rigid-body physics at 0.43 times, but the two big x64 wins vanish against a native-CPU build (1.38 times and 1.26 times).
- Only function-body edits patch live; struct layout, imports, trait or impl headers and macros need a restart, and relax check is not yet faster than cargo check.
- Makepad runs nine agent lanes and more than 300 build and test jobs an hour through Relax; an edit was patched 3.6 s at the median and 86 s at p90 on a cold JIT or cache.
Why it matters
Rust's compile-then-run loop is slow, and Relax attacks it by replacing rustc, LLVM and the linker with a JIT that compiles functions on first call and patches edits into the running process. Makepad's stated motivation is that an AI agent pays for every slow build in tokens, wall-clock and lost context, so the project runs its own agent fleet on it: nine lanes, more than 300 build and test jobs an hour. The trade is explicit. Steady-state code is slower than rustc's --release (geomean 1.12 times on x64, 1.24 times on arm64), so this is a tool for iteration, not for shipping.
Who it affects
Rust developers who spend their day in the edit-run loop are the target, and so are teams running AI agents that build and test constantly, as Makepad does. Makepad itself uses Relax for its makepad run tooling, which lives in Makepad's repository. People who need release binaries are not affected: those still come from rustc via cargo build --release.
How to use it
Clone github.com/makepad/relax, then build the runner with cargo build --release --manifest-path relax/Cargo.toml -p relax-runner --bin relax. This needs a stable Rust toolchain and nothing from crates.io, and took 53 s on a 16-core Linux box and 78 s on a 10-core arm64 Mac. Then, from a package's folder, run relax run --quiet
How solid is it
The page is candid and detailed, with a known-gaps file that lists each open issue with a repro and 96 end-to-end test packages in libs/relax/compiler. Tests pass from a fresh clone on Linux x86-64 and macOS arm64. All benchmark figures come from the project itself (median of 3 rounds, measured 2026-11-12); no independent or third-party benchmarks are cited. The 30-kernel micro-benchmark figures are flagged as provisional upper bounds because of a warm-cache tier-up bug, while the 21-workload table is stated to be unaffected. The page names no individual authors or maintainers, only the Makepad project, and gives no release date or version number.
Risks and caveats
Optimised code is slower than rustc --release overall, and the worst case, a 3D model build, takes about twice rustc's time. Memory use is higher because the compiler, caches and every published code version live in the program's process and JIT code is append-only; the hello package alone has a 120 to 190 MB code cache. Not every crate runs yet. relax check is slower and heavier than cargo check on large packages, and the authors say they are working on it, with no timescale given. The borrow checker runs in the background, so a program can start before it has been fully checked unless you pass --check-first. The page does not compare Relax's edit-to-run time with cargo's incremental builds, so the speed-up of the loop itself is not quantified against a rustc baseline. The page does not say Relax is production-ready or recommend it for anything beyond the development edit-run loop.
“An AI agent can't feel a slow build, but it pays for every one in tokens, wall-clock and lost context.”
— Relax project page, Makepad