Skip to content
indexable-incPublic

About

Rust compiler daemon on rust-analyzer: fast incremental cargo builds and live edits to running programs. Try: nix run github:indexable-inc/ra-jit

Topics

Resources

Contributing

Security policy

Stars

186 stars

Watchers

0 watching

Forks

Repository files navigation

ix ra-jit

Edit Rust. See it change in milliseconds, in the program that is already running.

nix run github:indexable-inc/ra-jit

That opens a Game of Life window you can edit while it runs (live on macOS Apple silicon).

Editing the running Game of Life: rule, colours and speed change live

Tell us you use ra-jit

For release news: Watch → Custom → Releases on GitHub.

What you get

  • Live edits. Save a file and the running program has the new code about a millisecond later. Its state stays. (docs/live.md)
  • Fast builds. After the first build, an edit rebuilds only the functions you changed. No rustc, no waiting.
  • Same cargo. cargo ra-jit build|run|test|check in any project.

How fast

Live edit to running code, Game of Life demo (median of 20 edits, one 96-core Linux machine):

Edit incremental cargo build ra-jit live
One function 169 ms 7 ms 24x
One function, 300 new functions added 282 ms 60 ms 4.7x

How many times faster an edit builds under ra-jit than under cargo, by platform: ripgrep 15.1.0: macOS arm64 8.1×, Linux aarch64 25×, Linux x86-64 14×; fd 10.3.0: macOS arm64 6.0×, Linux aarch64 27×, Linux x86-64 12×; bat 0.26.0: Linux aarch64 39×, Linux x86-64 19×; hyperfine 1.19.0: Linux aarch64 19×, Linux x86-64 12×; just 1.43.0: Linux aarch64 26×, Linux x86-64 16×; axum 0.8.6: Linux aarch64 16×, Linux x86-64 10×; nushell 0.108.0: macOS arm64 10.0×, Linux aarch64 40×, Linux x86-64 20×; helix 25.07.1: Linux aarch64 52×, Linux x86-64 28×; bevy 0.20.0: Linux aarch64 0.2×, Linux x86-64 0.3×

Edit, then build, on real projects at pinned commits: incremental cargo build → cargo ra-jit build, both warm, same linker, Cranelift, the median of each run's edits. Each platform is a machine of its own: compare numbers within a platform, not across.

An edit to one function, cargo → ra-jit:

Project macOS arm64 Linux aarch64 Linux x86-64
ripgrep 15.1.0 993 ms → 126 ms (7.9x) 1.27 s → 56 ms (23x) 787 ms → 69 ms (11x)
fd 10.3.0 630 ms → 109 ms (5.8x) 1.35 s → 49 ms (27x) 752 ms → 61 ms (12x)
bat 0.26.0 - 1.71 s → 54 ms (32x) 774 ms → 61 ms (13x)
hyperfine 1.19.0 - 787 ms → 39 ms (20x) 616 ms → 47 ms (13x)
just 1.43.0 - 1.57 s → 41 ms (38x) 1.04 s → 52 ms (20x)
axum 0.8.6 - 855 ms → 52 ms (16x) 668 ms → 66 ms (10x)
nushell 0.108.0 1.81 s → 454 ms (4.0x) 7.50 s → 295 ms (25x) 1.83 s → 293 ms (6.3x)
helix 25.07.1 - 7.21 s → 78 ms (92x) 3.07 s → 90 ms (34x)
bevy 0.20.0 - 23.76 s → 105.76 s (0.2x) 3.96 s → 11.60 s (0.3x)
  • macOS arm64: MacBook Pro (Mac17,6), macOS 27.0.1, with other work running (Apple M5 Max, 18 cores, 128 GiB), ra-jit 84760c3f51 on 2026-10-21, median of 3 edits, load average 48 at the start, by hand.
  • Linux aarch64: AWS c8g.16xlarge, pinned to 16 cores with taskset (Neoverse-V2, 16 of its 64 cores, 124 GiB), ra-jit 2cf189feb6 on 2026-10-22, median of 5 edits, load average 10 at the start, by hand.
  • Linux x86-64: AWS c7a.48xlarge (dev-aws-8), pinned to 16 cores with taskset (AMD EPYC 9R14, 16 of its 192 cores, 370 GiB), ra-jit 2cf189feb6 on 2026-10-22, median of 5 edits, load average 13 at the start, by hand.
Every kind of edit, by platform

macOS arm64

Project Edit a function Edit a widely used function Change a signature Nothing changed
ripgrep 15.1.0 993 ms → 126 ms (7.9x) 1.31 s → 159 ms (8.2x) 828 ms → 175 ms (4.7x) 67 ms → 54 ms (1.2x)
fd 10.3.0 630 ms → 109 ms (5.8x) 734 ms → 102 ms (7.2x) 681 ms → 113 ms (6.0x) 144 ms → 49 ms (2.9x)
nushell 0.108.0 1.81 s → 454 ms (4.0x) 14.39 s → 850 ms (17x) 10.28 s → 716 ms (14x) 407 ms → 45 ms (9.0x)

Linux aarch64

Project Edit a function Edit a widely used function Change a signature Nothing changed
ripgrep 15.1.0 1.27 s → 56 ms (23x) 1.65 s → 43 ms (38x) 1.44 s → 87 ms (16x) 27 ms → 20 ms (1.3x)
fd 10.3.0 1.35 s → 49 ms (27x) 1.30 s → 36 ms (36x) 1.36 s → 65 ms (21x) 35 ms → 18 ms (1.9x)
bat 0.26.0 1.71 s → 54 ms (32x) 2.00 s → 41 ms (49x) 1.95 s → 47 ms (42x) 67 ms → 18 ms (3.7x)
hyperfine 1.19.0 787 ms → 39 ms (20x) 828 ms → 41 ms (20x) 836 ms → 91 ms (9.2x) 46 ms → 18 ms (2.6x)
just 1.43.0 1.57 s → 41 ms (38x) 1.66 s → 42 ms (40x) 1.59 s → 73 ms (22x) 45 ms → 17 ms (2.6x)
axum 0.8.6 855 ms → 52 ms (16x) 1.44 s → 44 ms (33x) 78 ms → 19 ms (4.1x)
nushell 0.108.0 7.50 s → 295 ms (25x) 11.86 s → 273 ms (43x) 11.75 s → 323 ms (36x) 198 ms → 22 ms (9.0x)
helix 25.07.1 7.21 s → 78 ms (92x) 8.58 s → 91 ms (94x) 8.00 s → 246 ms (32x) 96 ms → 19 ms (5.1x)
bevy 0.20.0 23.76 s → 105.76 s (0.2x) 33.52 s → 105.54 s (0.3x) 226 ms → 23 ms (9.8x)

Linux x86-64

Project Edit a function Edit a widely used function Change a signature Nothing changed
ripgrep 15.1.0 787 ms → 69 ms (11x) 1.18 s → 54 ms (22x) 957 ms → 95 ms (10x) 36 ms → 25 ms (1.4x)
fd 10.3.0 752 ms → 61 ms (12x) 716 ms → 49 ms (15x) 759 ms → 76 ms (10.0x) 50 ms → 23 ms (2.2x)
bat 0.26.0 774 ms → 61 ms (13x) 1.12 s → 50 ms (22x) 1.06 s → 57 ms (19x) 95 ms → 23 ms (4.1x)
hyperfine 1.19.0 616 ms → 47 ms (13x) 660 ms → 48 ms (14x) 667 ms → 98 ms (6.8x) 67 ms → 24 ms (2.8x)
just 1.43.0 1.04 s → 52 ms (20x) 1.07 s → 52 ms (21x) 1.05 s → 83 ms (13x) 65 ms → 23 ms (2.8x)
axum 0.8.6 668 ms → 66 ms (10x) 1.31 s → 57 ms (23x) 117 ms → 25 ms (4.7x)
nushell 0.108.0 1.83 s → 293 ms (6.3x) 6.76 s → 301 ms (22x) 6.83 s → 372 ms (18x) 282 ms → 30 ms (9.4x)
helix 25.07.1 3.07 s → 90 ms (34x) 4.66 s → 105 ms (44x) 3.98 s → 270 ms (15x) 134 ms → 26 ms (5.2x)
bevy 0.20.0 3.96 s → 11.60 s (0.3x) 15.07 s → 12.85 s (1.2x) 305 ms → 33 ms (9.2x)

Measured by hand with harness/bench.py, or by the bench-readme workflow on each platform's benchmark machine once it is registered. The ra-jit measured is cargo build --release; the binaries a release ships are the dist profile with PGO, which start and edit faster (how). Cold builds, the spread of every number, the LLVM tier and how fast the built programs run: docs/benchmarks.md. Raw JSON: macOS arm64, Linux aarch64, Linux x86-64.

Peak memory while an edit to one function builds, by platform: ripgrep 15.1.0: macOS arm64 2.9 GB for ra-jit, 235 MB for cargo, Linux aarch64 3.7 GB for ra-jit, 463 MB for cargo, Linux x86-64 3.5 GB for ra-jit, 531 MB for cargo; fd 10.3.0: macOS arm64 2.6 GB for ra-jit, 212 MB for cargo, Linux aarch64 3.4 GB for ra-jit, 519 MB for cargo, Linux x86-64 3.3 GB for ra-jit, 605 MB for cargo; bat 0.26.0: Linux aarch64 4.0 GB for ra-jit, 672 MB for cargo, Linux x86-64 3.9 GB for ra-jit, 749 MB for cargo; hyperfine 1.19.0: Linux aarch64 3.6 GB for ra-jit, 360 MB for cargo, Linux x86-64 3.4 GB for ra-jit, 422 MB for cargo; just 1.43.0: Linux aarch64 4.1 GB for ra-jit, 434 MB for cargo, Linux x86-64 4.0 GB for ra-jit, 539 MB for cargo; axum 0.8.6: Linux aarch64 4.0 GB for ra-jit, 399 MB for cargo, Linux x86-64 3.9 GB for ra-jit, 468 MB for cargo; nushell 0.108.0: macOS arm64 12.5 GB for ra-jit, 1.1 GB for cargo, Linux aarch64 12.7 GB for ra-jit, 2.4 GB for cargo, Linux x86-64 12.5 GB for ra-jit, 2.7 GB for cargo; helix 25.07.1: Linux aarch64 14.2 GB for ra-jit, 1.8 GB for cargo, Linux x86-64 13.9 GB for ra-jit, 2.1 GB for cargo; bevy 0.20.0: Linux aarch64 50.4 GB for ra-jit, 6.7 GB for cargo, Linux x86-64 55.8 GB for ra-jit, 8.5 GB for cargo

Memory and disk, Cranelift, from the same runs as the build table. Peak: the most every process doing the work held at once, cargo → ra-jit. For ra-jit that is the daemon, its workers and what they run, and cargo ra-jit build with any cargo it ran; for plain cargo, cargo itself, rustc, build scripts and the linker. How it is measured: docs/benchmarks.md.

Peak while an edit to one function builds, cargo → ra-jit:

Project macOS arm64 Linux aarch64 Linux x86-64
ripgrep 15.1.0 235 MB → 2.9 GB 463 MB → 3.7 GB 531 MB → 3.5 GB
fd 10.3.0 212 MB → 2.6 GB 519 MB → 3.4 GB 605 MB → 3.3 GB
bat 0.26.0 - 672 MB → 4.0 GB 749 MB → 3.9 GB
hyperfine 1.19.0 - 360 MB → 3.6 GB 422 MB → 3.4 GB
just 1.43.0 - 434 MB → 4.1 GB 539 MB → 4.0 GB
axum 0.8.6 - 399 MB → 4.0 GB 468 MB → 3.9 GB
nushell 0.108.0 1.1 GB → 12.5 GB 2.4 GB → 12.7 GB 2.7 GB → 12.5 GB
helix 25.07.1 - 1.8 GB → 14.2 GB 2.1 GB → 13.9 GB
bevy 0.20.0 - 6.7 GB → 50.4 GB 8.5 GB → 55.8 GB
The daemon between edits, cold builds and disk, by platform

macOS arm64

Project Edit a function, peak Daemon between edits Cold until ready, peak On disk
ripgrep 15.1.0 235 MB → 2.9 GB 2.2 GB ready, 2.8 GB after 39 builds 541 MB → 2.4 GB 416 MB → 598 MB
fd 10.3.0 212 MB → 2.6 GB 1.8 GB ready, 2.6 GB after 33 builds 897 MB → 1.9 GB 355 MB → 460 MB
nushell 0.108.0 1.1 GB → 12.5 GB 11.5 GB ready, 12.5 GB after 39 builds 2.4 GB → 16.1 GB 5.3 GB → 6.9 GB

Linux aarch64

Project Edit a function, peak Daemon between edits Cold until ready, peak On disk
ripgrep 15.1.0 463 MB → 3.7 GB 1.9 GB ready, 3.6 GB after 65 builds 1.9 GB → 2.7 GB 404 MB → 629 MB
fd 10.3.0 519 MB → 3.4 GB 2.0 GB ready, 3.4 GB after 55 builds 2.2 GB → 3.6 GB 780 MB → 976 MB
bat 0.26.0 672 MB → 4.0 GB 2.6 GB ready, 4.0 GB after 55 builds 3.4 GB → 6.1 GB 980 MB → 1.3 GB
hyperfine 1.19.0 360 MB → 3.6 GB 2.2 GB ready, 3.6 GB after 55 builds 2.2 GB → 2.6 GB 340 MB → 466 MB
just 1.43.0 434 MB → 4.1 GB 2.4 GB ready, 4.1 GB after 55 builds 3.1 GB → 3.7 GB 664 MB → 971 MB
axum 0.8.6 399 MB → 4.0 GB 2.7 GB ready, 4.0 GB after 35 builds 2.1 GB → 3.2 GB 405 MB → 511 MB
nushell 0.108.0 2.4 GB → 12.7 GB 5.8 GB ready, 12.6 GB after 65 builds 4.6 GB → 8.3 GB 5.3 GB → 7.5 GB
helix 25.07.1 1.8 GB → 14.2 GB 4.6 GB ready, 14.1 GB after 55 builds 3.5 GB → 6.4 GB 3.7 GB → 7.8 GB
bevy 0.20.0 6.7 GB → 50.4 GB 8.9 GB ready, 42.1 GB after 35 builds 6.8 GB → 11.1 GB 17.5 GB → 37.8 GB

Linux x86-64

Project Edit a function, peak Daemon between edits Cold until ready, peak On disk
ripgrep 15.1.0 531 MB → 3.5 GB 1.8 GB ready, 3.5 GB after 65 builds 2.4 GB → 2.9 GB 407 MB → 631 MB
fd 10.3.0 605 MB → 3.3 GB 1.9 GB ready, 3.3 GB after 55 builds 2.7 GB → 3.2 GB 636 MB → 863 MB
bat 0.26.0 749 MB → 3.9 GB 2.5 GB ready, 3.9 GB after 55 builds 3.7 GB → 5.8 GB 973 MB → 1.3 GB
hyperfine 1.19.0 422 MB → 3.4 GB 2.1 GB ready, 3.4 GB after 55 builds 2.5 GB → 3.0 GB 342 MB → 466 MB
just 1.43.0 539 MB → 4.0 GB 2.2 GB ready, 4.0 GB after 55 builds 3.4 GB → 4.2 GB 667 MB → 980 MB
axum 0.8.6 468 MB → 3.9 GB 2.6 GB ready, 3.9 GB after 35 builds 2.5 GB → 3.3 GB 404 MB → 507 MB
nushell 0.108.0 2.7 GB → 12.5 GB 6.1 GB ready, 12.5 GB after 65 builds 4.6 GB → 9.0 GB 5.3 GB → 7.5 GB
helix 25.07.1 2.1 GB → 13.9 GB 4.5 GB ready, 13.9 GB after 55 builds 3.8 GB → 6.5 GB 3.7 GB → 7.8 GB
bevy 0.20.0 8.5 GB → 55.8 GB 10.4 GB ready, 43.3 GB after 35 builds 8.5 GB → 10.4 GB 17.6 GB → 35.9 GB

On disk: cargo's target directory → ra-jit's target directory, store and home.

Time of each benchmark, ra-jit's build ÷ cargo build --release, by platform: macOS arm64 geometric mean 1.19×; Linux x86-64 geometric mean 1.12×

How fast the programs run. Each program is built by cargo build --release and by ra-jit with LLVM at -O3, every crate of it compiled by ra-jit, with the release profile; each benchmark is then run several times, the builds taking turns, median. A run is published only when every program did what the release build's did. Each platform is a machine of its own, and each number is ra-jit's time ÷ release's on it: 1x is as fast.

Benchmark macOS arm64 Linux aarch64 Linux x86-64
sieve 1.03x - 0.82x
collatz 1.00x - 1.00x
fnv 1.01x - 1.00x
qsort 0.98x - 0.99x
matmul 1.11x - 1.11x
nbody 3.75x - 1.38x
mandelbrot 0.99x - 1.00x
words 1.42x - 1.32x
numeric 1.26x - 0.98x
jsonrt 1.28x - 1.30x
ripgrep ≈1.16x - 1.10x
fd ≈1.12x - 1.18x
tokei ≈2.03x - 1.47x
eza ≈0.49x - 1.08x
bat 1.09x - 1.23x
Geometric mean 1.19x - 1.12x

≈: that benchmark's runs varied by more than 1.5× from fastest to slowest on that machine; read it as rough.

  • macOS arm64: GitHub-hosted macos-15 runner, a shared VM (Apple M1 (Virtual), 3 cores, 7 GiB), ra-jit efd7e4bbeb on 2026-10-22, each benchmark run 5 times, load average 15 at the start, by CI.
  • Linux aarch64: not measured yet (the machines).
  • Linux x86-64: AWS c7a.48xlarge (dev-aws-8), pinned to 16 cores with taskset (AMD EPYC 9R14, 16 of its 192 cores, 370 GiB), ra-jit 2cf189feb6 on 2026-10-22, each benchmark run 5 times, load average 12 at the start, by hand.
Times, memory and builds, by platform

macOS arm64

Benchmark cargo build --release ra-jit, LLVM ra-jit ÷ release release with dev checks ÷ release Peak memory, release → ra-jit
sieve 49 ms 51 ms 1.03x 0.99x 17 MB → 17 MB
collatz 160 ms 160 ms 1.00x 1.40x 1 MB → 2 MB
fnv 93 ms 94 ms 1.01x 1.02x 2 MB → 2 MB
qsort 260 ms 256 ms 0.98x 1.00x 13 MB → 13 MB
matmul 40 ms 45 ms 1.11x 0.92x 4 MB → 4 MB
nbody 31 ms 115 ms 3.75x 1.05x 1 MB → 2 MB
mandelbrot 343 ms 339 ms 0.99x 1.00x 1 MB → 2 MB
words 83 ms 118 ms 1.42x 0.95x 2 MB → 2 MB
numeric 79 ms 99 ms 1.26x 1.09x 13 MB → 15 MB
jsonrt 1.10 s 1.40 s 1.28x 1.07x 588 MB → 601 MB
ripgrep 186 ms 215 ms ≈1.16x 0.97x 5 MB → 7 MB
fd 48 ms 54 ms ≈1.12x 0.94x 7 MB → 8 MB
tokei 588 ms 1.19 s ≈2.03x 1.12x 26 MB → 28 MB
eza 1.05 s 514 ms ≈0.49x 0.83x 19 MB → 24 MB
bat 109 ms 119 ms 1.09x 0.85x 12 MB → 15 MB
Geometric mean 1.19x 1.01x

What each program takes, release → ra-jit: its build from cold (for ra-jit, cargo running the build scripts and proc macros, ra-jit's compile of every crate and the link), its size, and its build's memory (the most the build's processes held at once, and the largest one process: rustc or ra-jit, or the linker).

Program Build Size Build, peak Build, largest process
kernels 600 ms → 7.40 s 0.48 MB → 1.62 MB 146 MB → 1.1 GB 146 MB → 1.1 GB
numeric 4.30 s → 28.30 s 0.75 MB → 2.21 MB 287 MB → 1.3 GB 287 MB → 1.3 GB
jsonrt 8.60 s → 59.90 s 0.97 MB → 2.65 MB 532 MB → 1.9 GB 428 MB → 1.9 GB
ripgrep 34.10 s → 217.70 s 6.66 MB → 10.83 MB 565 MB → 2.8 GB 401 MB → 2.8 GB
fd 53.90 s → 187.60 s 3.0 MB → 8.74 MB 758 MB → 2.9 GB 758 MB → 2.8 GB
tokei 37.50 s → 262.70 s 4.22 MB → 10.78 MB 543 MB → 3.3 GB 428 MB → 3.3 GB
eza 78.10 s → 204.40 s 2.0 MB → 15.7 MB 547 MB → 3.1 GB 547 MB → 3.1 GB
bat 102.40 s → 527.70 s 6.65 MB → 16.7 MB 1.2 GB → 4.9 GB 1.2 GB → 4.9 GB

Linux x86-64

Benchmark cargo build --release ra-jit, LLVM ra-jit ÷ release release with dev checks ÷ release Peak memory, release → ra-jit
sieve 47 ms 39 ms 0.82x 0.84x 21 MB → 21 MB
collatz 113 ms 114 ms 1.00x 1.82x 21 MB → 21 MB
fnv 73 ms 73 ms 1.00x 1.00x 21 MB → 21 MB
qsort 236 ms 234 ms 0.99x 0.99x 21 MB → 21 MB
matmul 26 ms 29 ms 1.11x 1.00x 21 MB → 21 MB
nbody 27 ms 38 ms 1.38x 1.00x 21 MB → 21 MB
mandelbrot 236 ms 237 ms 1.00x 1.10x 21 MB → 21 MB
words 59 ms 78 ms 1.32x 1.03x 21 MB → 21 MB
numeric 29 ms 29 ms 0.98x 1.01x 21 MB → 21 MB
jsonrt 1.36 s 1.76 s 1.30x 1.04x 540 MB → 542 MB
ripgrep 78 ms 85 ms 1.10x 1.05x 21 MB → 21 MB
fd 26 ms 31 ms 1.18x 1.01x 21 MB → 21 MB
tokei 105 ms 154 ms 1.47x 1.03x 26 MB → 26 MB
eza 233 ms 252 ms 1.08x 1.03x 27 MB → 27 MB
bat 86 ms 106 ms 1.23x 1.02x 27 MB → 27 MB
Geometric mean 1.12x 1.05x

What each program takes, release → ra-jit: its build from cold (for ra-jit, cargo running the build scripts and proc macros, ra-jit's compile of every crate and the link), its size, and its build's memory (the most the build's processes held at once, and the largest one process: rustc or ra-jit, or the linker).

Program Build Size Build, peak Build, largest process
kernels 500 ms → 4.00 s 0.5 MB → 1.52 MB 256 MB → 1.5 GB 192 MB → 1.5 GB
numeric 3.30 s → 11.40 s 0.81 MB → 2.17 MB 729 MB → 2.0 GB 330 MB → 1.9 GB
jsonrt 6.10 s → 20.00 s 1.07 MB → 2.77 MB 2.4 GB → 2.8 GB 458 MB → 2.7 GB
ripgrep 8.20 s → 48.10 s 31.4 MB → 21.16 MB 2.8 GB → 4.2 GB 611 MB → 4.1 GB
fd 54.50 s → 110.30 s 4.16 MB → 7.73 MB 2.8 GB → 4.1 GB 496 MB → 4.0 GB
tokei 13.70 s → 67.20 s 5.51 MB → 12.07 MB 3.6 GB → 5.0 GB 515 MB → 4.9 GB
eza 33.90 s → 51.70 s 2.69 MB → 11.6 MB 3.8 GB → 5.0 GB 508 MB → 4.8 GB
bat 48.90 s → 129.10 s 7.56 MB → 14.23 MB 4.0 GB → 6.9 GB 728 MB → 6.8 GB

Release with dev checks: cargo build --release with -C overflow-checks=on -C debug-assertions=on.

Measured by hand with harness/bench.py --runtime (harness/runbench.py), or by the bench-readme workflow on each platform's benchmark machine once it is registered. Raw JSON: macOS arm64, Linux x86-64.

bun

bun's Rust port, 1.4.3: 1.25M lines of Rust in 103 crates on a nightly, beside a JavaScript engine's C and C++ (what it took).

Edit, then build, bun at its pinned commit: incremental cargo build → cargo ra-jit build, both warm, same linker, Cranelift, the median of each run's edits. Each platform is a machine of its own: compare numbers within a platform, not across.

Platform Edit a function Edit a widely used function Change a signature Nothing changed
macOS arm64 12.16 s → 1.09 s (11x) 26.75 s → 1.81 s (15x) 9.83 s → 126.44 s (c) (0.1x) 168 ms → 73 ms (2.3x)
Linux aarch64 not measured yet
Linux x86-64 not measured yet
  • macOS arm64: one machine (Apple M5 Max, 18 cores, 128 GiB), ra-jit 1645168dc4 on 2026-10-21, load average 28 at the start, by hand.
  • Linux aarch64: not measured yet (the machines).
  • Linux x86-64: not measured yet (the machines).

(c): the daemon handed this edit to cargo (a fallback, so about cargo's time).

Measured by hand with harness/bench.py, or by the bench-bun workflow on each platform's benchmark machine once it is registered. The ra-jit measured is cargo build --release; the binaries a release ships are the dist profile with PGO, which start and edit faster (how). Raw JSON: macOS arm64.

ra-jit's whole-program build of bun does not link yet: about 1,300 of its functions are not compiled (#35), so how fast it runs is not measured.

Not measured yet: test suites (#benchmarks).

Try it on your project

nix run github:indexable-inc/ra-jit#ra-jit -- build

No nix? Put the binaries from a release on your PATH, or build them with cargo +1.99.0 install --locked --profile dist ra-jit. Then use Rust 1.99.0 with its source: rustup toolchain install 1.99.0 -c rust-src && rustup override set 1.99.0.

A release's binaries and nix build the same ra-jit: the dist profile (thin LTO), optimized with the profile of its own work that pgo/profiles.json pins (how). cargo install builds dist without that last step, which on Linux starts about 10% slower and edits about 3% slower than a release's binaries: cargo takes no compiler flags from a crate, and the crates it builds from crates.io are not the ones the profile was made of, so none could be handed to it either. (--profile dist comes with the first release after 0.1.0.)

Use it as your normal cargo build

nix profile install github:indexable-inc/ra-jit#ra-jit
ra-jit enable

From then on plain cargo build, run, test and check in any project go through ra-jit. ra-jit disable puts your cargo config back.

Live edits

Add the crate and poll once per frame:

ra-jit-live = "0.1"
let mut live = ra_jit_live::Live::start().ok();
loop {
    if let Some(outcome) = live.as_mut().and_then(|it| it.poll()) {
        eprintln!("ra-jit: {outcome}");
    }
    // ...your frame
}

Cached functions

#[ra_jit::cache] on a pure function keeps its results across runs, until an edit changes the code it reaches (docs/fn-cache.md).

What to know

  • Live edits work on macOS Apple silicon only. Elsewhere you still get fast builds.
  • An edit with a borrow-check error is refused, but the borrow checker still misses about a third of rustc's errors: cargo check stays the final word.
  • Rust 1.99.0 only.
  • Changing a struct the program is using asks for a restart.

More: how it works, full results, what is supported.

Credits

ra-jit stands on the shoulders of giants. Thank you to the people who built:

  • rust-analyzer, whose analysis and MIR ra-jit compiles from
  • Cranelift (Bytecode Alliance), the fast code generator
  • LLVM and inkwell, for the optimised tiers
  • salsa, the incremental engine underneath
  • object, for reading and writing executables
  • Rust and its compiler crates
  • rustd (DioxusLabs), whose code ra-jit includes

None of these projects endorses ra-jit.

Made at ix for den's native app. MIT or Apache-2.0.

About

Rust compiler daemon on rust-analyzer: fast incremental cargo builds and live edits to running programs. Try: nix run github:indexable-inc/ra-jit

Topics

Resources

Contributing

Security policy

Stars

186 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages