Expand description
Shared runners for benches/pvm_bench.rs and benches/stark_bench.rs.
The bench measures the full per-invocation lifecycle:
Nub::put_cap_with_hashfor each cap the invocation requires (Data blobs the Image references, the Image itself, the empty root cnode, the Instance). Each put is a singleBTreeMap::get + refcount.fetch_add(1)after warm-up — i.e. a few tens of nanoseconds per cap.Nub::invoke_cached(instance_hash, endpoint, args, gas).
run_interpreter—Nub::new_local()drives the byte-PVM interpreter (javm-exec) in-process.run_recompiler— a long-livedNub::new_hyperlight()sandbox (cached in aOnceLock) drives the in-kernel JIT path through the sameinvoke_cachedAPI.
BuiltCaps holds the pre-built Cap graph + its precomputed
hashes. Construction happens once per workload at bench warm-up via
BuiltCaps::for_image; the iter loop reuses the resulting handles.
Linux x86-64 only — nub pulls the Hyperlight host stack
unconditionally.
Structs§
- Built
Caps - Pre-built
Capgraph for one (image, endpoint) bench cell.
Functions§
- run_
interpreter - Drive
built[endpoint_idx]through the byte-PVM interpreter via a freshNub::new_local()(the Local backend has no per-invocation state, so a fresh Nub each call is fine — and matches the chain’s per-event allocation model). - run_
recompiler - Drive
built[endpoint_idx]through the in-kernel JIT via the long- lived HyperlightNub.