Repository navigation
runtime: the super path no longer reads PERRY_SUPER_DEBUG (three leftover debug prints removed) - #14474
Merged
Conversation
…over debug prints removed)
Pre-merge checks:
|
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.
What
Removes the three
if std::env::var_os("PERRY_SUPER_DEBUG").is_some() { eprintln!(...) }blocks fromcrates/perry-runtime/src/object/class_constructors.rs(super_applyentry,super_applyresolved ancestor,flat_super). The super path no longer reads any environment variable.git grep PERRY_SUPER_DEBUG -- crates/is empty. 25 lines deleted, nothing added.Why
The switch is a leftover from two old fixes (#5050, #5959); nothing else reads it. Each block cost an environment lookup per super call. The alternative, reading it once through a
OnceLock, was rejected: it adds a once-check on the hotrun_class_constructor_on_this_flatpath and bytes to every binary:Startup may not grow and a debug switch should not cost bytes in every binary, so the prints are deleted.
Gate (exact callgrind Ir, 5 runs/arm, main arm b2a72cf = base, same binary path, setarch -R, /root/ctl controls; A/A all 0)
The two + rows are layout-derived:
core::str::converts::from_utf8(+30 Ir). Per-callee call counts are identical (2292 callees, 0 differing; from_utf8 2109 calls both arms).run_class_constructor_on_this_flatitself is -3 Ir._Unwind_Find_FDE+160 andcapture_js_return_addresses+2, offset by -5/-28 infind_handler/ gimli parse._Unwind_Find_FDEis called 18 times in both arms; the only differing call counts are gimliparse_encoded_pointer117 vs 116 andparse_encoded_value133 vs 132, i.e. one fewer step in the eh_frame_hdr binary search, which follows the FDE table (the head runtime has one more FDE). Not in any touched function.decode_raw_pointer_candidate3845 vs 3848 does not recur: fastify_inject is 3845/3845, 0 differing callees..text (readelf, bytes)
hello file size 8942592 -> 8942464 (-128). hello md5 (unpadded) main 228e8a063dd2740528e3e15348d6253c, head 9f3f1d86f58dcb01176ae6f605a4fcb6.
Tests
RUSTFLAGS="-D warnings" cargo check -p perry-runtime: fails only on main's existing unused import atcrates/perry-runtime/src/intl.rs:72(no warning in class_constructors.rs).cargo check --workspace --exclude perry-ui-gtk4: ok.RUST_TEST_THREADS=1 cargo test --release -p perry-runtime: 6667 passed, 0 failed, 48 ignored.