Internals

Performance

NanoVM is an interpreter, so guest code runs slower than native. Here is an honest picture of the overhead and how to work with it.

It's emulation

Every guest instruction is decoded and dispatched in software. The slowdown versus native depends heavily on the workload — from tens of times for I/O- and allocation-heavy code, up to a few orders of magnitude for tight compute loops.

Rough tiers

Workload
Slowdown vs native
V8-heavy — JSON, object allocation, I/O
~47–200×
Mixed — crypto, regex, string work
~200–600×
Tight ALU / buffer loops
~600–1600×

Interpreter throughput is on the order of hundreds of MIPS today; block-level optimizations to push that higher are in progress.

Working with it

  • Use the Node snapshot fast path (NodeRuntime) to avoid repeated V8 boots.
  • Host the VM in a Web Worker so the UI thread stays responsive.
  • Keep hot loops small, or push heavy lifting into host functions exposed to scripts.
  • Bound untrusted work with the maxSteps instruction budget.
For interactive dev tooling — editors, linters, type-checks, small scripts, demos — this is comfortably fast. It is not a production compute runtime.