You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only rustpython-doc/-literal/-common/-wtf8 pin codegen-units = 1, and the bench profile already uses lto = "thin" + codegen-units = 1 — so benchmark numbers aren't even measuring the same codegen as the shipped binary. With 16 codegen units, LLVM can't inline across unit boundaries inside rustpython-vm itself, and the eval loop (ExecutingFrame::run + its helper functions) is exactly the kind of code that suffers: profiles show push_value/pop_value/cache_entries/as_opcode as separate un-inlined symbols eating 10%+ combined.
Suggested changes
codegen-units = 1 on [profile.release] (or at least for rustpython-vm and rustpython-compiler-core via package overrides). Build time cost is real but this is the distributed/benchmarked artifact.
Try lto = "fat" — with a workspace this size it often buys a few percent over thin, worth one measurement pass.
Consider a PGO build recipe (cargo-pgo or manual -Cprofile-generate/-Cprofile-use driven by the benchmark suite) for release artifacts; interpreters typically get 5–15% from PGO because of the giant dispatch match. Even if not wired into CI, documenting the recipe in DEVELOPMENT.md lets anyone produce a fast binary.
While measuring, also compare panic = "abort" for the CLI binary (the vm relies on unwinding? if so, skip this).
Low effort, measurable, and orthogonal to the structural issues in this series — a good first PR to establish the benchmarking workflow.
Researched and written by Claude on behalf of @youknowone. Part of the performance tracking series.
Activity