Skip to content

[heft-native] Opt-in Rust front end and plan-driven Node host - #6098

Draft
Sean Larkin (TheLarkInn) wants to merge 1 commit into
thelarkinn/heft-startup-v2from
thelarkinn/heft-native-rust
Draft

Sean Larkin (TheLarkInn) wants to merge 1 commit into
thelarkinn/heft-startup-v2from
thelarkinn/heft-native-rust

Conversation

@TheLarkInn

@TheLarkInn Sean Larkin (TheLarkInn) commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Opt-in native heft. Nothing changes for existing users.

Stacked on #6097, so this diff is the Rust work only. Full diff vs main: main...thelarkinn/heft-native-rust

Before → after

heft 1.3.1 → native binary. Same setup as the v2 PR.

Before After Speedup
heft --help, --version, <action> --help 413 ms 2.6 ms 159×
Build with only built-in tasks 425 ms 2.4 ms 177×
First task, JS plugins, cold 423 ms 85 ms 5.0×
First task, JS plugins, warm host (opt-in) 423 ms 26 ms 16×
Peak RSS, --help ~85 MiB 2.6 MiB −97%

What it is

  • apps/heft-native: a std-only Rust binary. No dependencies. No Node bindings. 838 KB.
  • Rust handles the CLI, config, rigs, plugin resolution, schema validation, heft clean, and copy/delete/set-env builds.
  • JS plugins run in a plan-driven Node host (apps/heft/src/host). Rust execs node with the plan.
  • HEFT_WARM_HOST=1 keeps single-use hosts ready on a private Unix socket.

Not disruptive

  • Not a Rush project. rush install and rush build work without cargo.
  • @rushstack/heft defaults and API reports unchanged.

Try it

cd apps/heft-native && cargo build --release
cd ../../build-tests/heft-node-everything-test
../../apps/heft-native/target/release/heft --help

Limits

  • Linux only. Windows compiles, untested.
  • Interactive terminals, watch, --debug, --verbose and config errors defer to JS heft.
  • Warm hosts cost ~14 MiB more each.
  • New files carry no license header, per a no-comments rule. Needs a call.

Experiment stacked on this: #6099 — Round 4 assembly/SIMD squeeze (SIMD JSON scans, SHA-NI, syscall cuts, static link).

A std-only Rust binary in apps/heft-native. No dependencies, no Node
bindings. Rust answers the CLI, config, rigs, plugin resolution, clean
and builds that use only built-in copy/delete/set-env tasks. JS plugins
run in a Node host that receives a plan (apps/heft/src/host). An
opt-in warm host listens on a private Unix socket.

heft --help: 413 ms -> 2.6 ms. Built-in-only build: 2.4 ms.
First task with JS plugins: 85 ms cold, 26 ms warm (opt-in).
Not a Rush project; rush install and rush build are unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant