perf: add VM and GC telemetry notes#127
Merged
Merged
Conversation
Add attribution for the upstream project this is an AI-assisted derivative (translation) of, satisfying the permissive-license requirement to retain the original copyright notice. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b441fca to
b67d54d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
harness/bench/value-layout.shplus alua-vmexample to measure Rust value/frame/object layout against reference Lua 5.4.7 C structsharness/bench/profile-inventory.shto inventory available host profilers and repo telemetry probesvm-execute-attribution.pyto reportexecute_source_nodes, warn whensamplelacks source-line data forlua_vm::vm::execute, and split opaque/line-0 VM samples by source file plus compact address-offset bundlesprofile-hotspots.shand document the required debug/frame-pointer release buildgc-profile.shwith a start snapshot,gc-delta.tsv, andgc-rates.tsvso collector profiles show cadence deltas and per-run/per-second ratesKey findings
LuaValuecurrently measures 16 bytes, matching C Lua 5.4.7TValue; the old "24-byte LuaValue" ceiling claim was wrong.StackValueis 24 bytes vs CStackValue16 bytes, RustCallInfois 72 bytes vs CCallInfo64 bytes, and Rust table/upvalue heap objects are larger.closure_ops_x40has dispatch fetch 26.8% of VM self-samples,OP_CALL13.3%, frame setup 9.7%;fibonacci_x2has dispatch fetch 22.6%,OP_CALL14.1%, frame setup 7.5%.UNKNOWN_INLINEDis truly VM-local (vm.rs:0) or standard-library/value inlining (result.rs:0,value.rs:0) before escalating to heavier tooling. It also preserves the raw address-offset bundle, which shows when a line-0 bucket is aggregating multiple code addresses.gc_pressureis collection cadence/fixed-step cost,binarytreesis cohort/old-revisit volume, andtable_hash_pressureis string-key write path plus intern/concat allocation with GC stopped.#[cold] #[inline(never)]split fortrace_call/trace_execfailed the hook-heavydb.luaofficial test with a debug CLI segfault, so dispatch cold-path work needs correctness coverage before benchmark claims.LuaTable::try_raw_set_genericdid not produce a keeper signal in focused best-of-5 table/GC A/B runs; leave that path alone unless a longer controlled run says otherwise.Evidence
harness/bench/results/20260602T183215Z-98bd6bd-compare.tsvharness/bench/profiles/20260602T184054Z-18c5f24-closure_ops_x40/vm-execute.txtharness/bench/profiles/20260602T184108Z-18c5f24-fibonacci_x2/vm-execute.txtpython3 harness/bench/vm-execute-attribution.py harness/bench/profiles/20260602T184054Z-18c5f24-closure_ops_x40/sample.txt --source crates/lua-vm/src/vm.rspython3 harness/bench/vm-execute-attribution.py harness/bench/profiles/20260602T192236Z-e1483a6-table_hash_pressure_x100/sample.txt --source crates/lua-vm/src/vm.rs(vm.rs:0=460,32356,...;result.rs:0=17208;value.rs:0=6536)harness/bench/profiles/20260602T191942Z-e1483a6-gc_pressure_x300/summary.txtharness/bench/profiles/gc-profile/20260602T192753Z-e1483a6-gc_pressure_x300/gc-rates.tsvharness/bench/profiles/20260602T191955Z-e1483a6-binarytrees_x15/summary.txtharness/bench/profiles/gc-profile/20260602T192812Z-e1483a6-binarytrees_x15/gc-rates.tsvharness/bench/profiles/20260602T192236Z-e1483a6-table_hash_pressure_x100/summary.txtharness/bench/profiles/gc-profile/20260602T192829Z-e1483a6-table_hash_pressure_x100/gc-rates.tsvharness/bench/results/20260602T193855Z-4558473-compare.tsv,harness/bench/results/20260602T193949Z-4558473-compare.tsvbash harness/bench/value-layout.shbash harness/bench/profile-inventory.shPROFILE_REPEAT=2 bash harness/bench/profile-hotspots.sh fibonacci 2on a normal release buildCARGO_PROFILE_RELEASE_DEBUG=true RUSTFLAGS="-C force-frame-pointers=yes" cargo build --release -p lua-clibash harness/run_official_test.sh reference/lua-c/testes/db.luaafter rebuilding debug CLI with cold trap wrappersValidation
bash -n harness/bench/value-layout.shbash -n harness/bench/profile-inventory.shbash -n harness/bench/profile-hotspots.shbash -n harness/bench/gc-profile.shpython3 -m py_compile harness/bench/vm-execute-attribution.pypython3 -m py_compile harness/bench/gc-profile-summary.pypython3 harness/bench/vm-execute-attribution.py harness/bench/profiles/20260602T184054Z-18c5f24-closure_ops_x40/sample.txt --source crates/lua-vm/src/vm.rspython3 harness/bench/vm-execute-attribution.py harness/bench/profiles/20260602T192236Z-e1483a6-table_hash_pressure_x100/sample.txt --source crates/lua-vm/src/vm.rsbash harness/bench/profile-inventory.shcargo run --quiet -p lua-vm --example value_layoutbash harness/bench/value-layout.shcargo build --release -p lua-cliPROFILE_REPEAT=1 bash harness/bench/gc-profile.sh gc_pressuregit diff --checkmake testStacked on #126. This PR is documentation/tooling telemetry only; it makes no runtime speed claim.