perf(registry): record bounded layout load and GC evidence for PLN-0176 step 35
This commit is contained in:
@@ -258,3 +258,31 @@ fn constant_strings_share_image_domain_across_sessions_and_native_snapshots() {
|
||||
let Value::String(text) = &snapshot[0] else { panic!() };
|
||||
assert_eq!(text.as_ref(), "shared");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "explicit release measurement; not a timing assertion"]
|
||||
fn sealed_image_load_probe() {
|
||||
use std::time::Instant;
|
||||
let constants: Vec<_> =
|
||||
(0..512).map(|index| K::String(format!("{index:04}:{}", "x".repeat(59)))).collect();
|
||||
let bytes = fixture(&[1, 0], 0, &constants, None, &[]);
|
||||
let mut budget = budget();
|
||||
let start = Instant::now();
|
||||
let image = ValidatedProgramImage::load(&bytes, &mut budget, caps::NONE).unwrap();
|
||||
let elapsed = start.elapsed().as_nanos();
|
||||
assert_eq!(image.constant_content(), (32768, 512));
|
||||
assert_eq!(budget.used(Q::TemporaryBytes), 0);
|
||||
println!(
|
||||
"image arch={} pbx={} registry={} payload={} work={} peak_scratch={} retained_scratch={} strings={} allocations={} load_ns={}",
|
||||
std::env::consts::ARCH,
|
||||
bytes.len(),
|
||||
image.registry_bytes(),
|
||||
image.payload_bytes(),
|
||||
budget.used(Q::Work),
|
||||
budget.peak_usage(Q::TemporaryBytes),
|
||||
budget.used(Q::TemporaryBytes),
|
||||
image.constant_content().0,
|
||||
image.constant_content().1,
|
||||
elapsed
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user