The batch.ts ranked profile (Pi 5, perf record instructions:u, THROTTLE==0 asserted, 99.85% coverage; full account on #7170) found:
57.4% of the program is GC bookkeeping — and zero collections run (PERRY_GC_DIAG silent, no mark/sweep symbol appears). The largest single symbol is classify_heap_generation at 19.03% (657M instructions) — 2.3× the next symbol — called from the write barrier on the sort's own element stores. The layout side-table machinery adds another 12.91%.
Per comparison: ~2,597 instructions, of which sort scaffolding (dominated by barrier/layout bookkeeping) costs 1,495 — more than the user's comparator logic (1,103).
Why this needs its own lever
The planned levers were mapped against the profile: #6759 (shape tree) squarely hits the 12.91% layout side-table; #7151/#7170-R1 hit generated-code costs. Nothing planned addresses rank 1. A write barrier that spends 19% of the program classifying heap generations for a heap that has never collected is pure overhead by construction.
Candidate directions (to be designed, not prescribed):
Also from the same profile
utf16_cmp_bytes (string/compare.rs:15) runs from_utf8 validation + UTF-16 re-encode on BOTH operands per comparison — an ASCII fast path deletes ~3.1% of total program instructions (separate, trivial PR).
- The vdispatch-tower lever is NOT supported by this workload: comparator dispatch resolves a direct fn pointer once (
array/sort.rs:23); total closure dispatch 0.08%.
The batch.ts ranked profile (Pi 5,
perf recordinstructions:u, THROTTLE==0 asserted, 99.85% coverage; full account on #7170) found:57.4% of the program is GC bookkeeping — and zero collections run (
PERRY_GC_DIAGsilent, no mark/sweep symbol appears). The largest single symbol isclassify_heap_generationat 19.03% (657M instructions) — 2.3× the next symbol — called from the write barrier on the sort's own element stores. The layout side-table machinery adds another 12.91%.Per comparison: ~2,597 instructions, of which sort scaffolding (dominated by barrier/layout bookkeeping) costs 1,495 — more than the user's comparator logic (1,103).
Why this needs its own lever
The planned levers were mapped against the profile: #6759 (shape tree) squarely hits the 12.91% layout side-table; #7151/#7170-R1 hit generated-code costs. Nothing planned addresses rank 1. A write barrier that spends 19% of the program classifying heap generations for a heap that has never collected is pure overhead by construction.
Candidate directions (to be designed, not prescribed):
classify_heap_generationis a multi-branch/side-table walk, an address-range check or a header bit may collapse it.new#6893's O(objects) memory concern is the same machinery.Also from the same profile
utf16_cmp_bytes(string/compare.rs:15) runsfrom_utf8validation + UTF-16 re-encode on BOTH operands per comparison — an ASCII fast path deletes ~3.1% of total program instructions (separate, trivial PR).array/sort.rs:23); total closure dispatch 0.08%.