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
{{ message }}
Repository navigation
perf: helpers reading several fields of one or two parameters pay a full IC tower per read and boxed arithmetic (cli-table3 layout: 13x Node instructions) #12328
A helper that reads several fields from one or two untyped parameters pays a full inline-cache tower per read: a receiver check, a shape compare and a boxed result. Arithmetic on those values is guarded and generic. Real example: cli-table3's layout code. A verbatim copy of its nine layout functions, laying out a 2,000 × 7 table, costs 69.4 G instructions on Perry vs 5.3 G on Node, with 6.5 s vs 0.6 s wall (main 718ca28).
cellsConflict takes 52% of self cycles and its caller conflictExists 35%; the generic IC front takes 7–11%.
One IC site per read. The 12 reads are independent generic sites (expr/property_get/generic_dispatch.rs). The existing statement-run read regions (expr/region_read_run.rs, stmt/region_read_stmts.rs) need consecutive let a = o.k statements, so operator trees that mix two receivers with || never form a run.
No field representation. A hit returns a boxed value, because the site word holds (ShapeId, slot) and no field representation. So - 1 + (...), || and > take the guarded_arith / js_is_truthy / dyncmp paths, and each let gets a shadow-root slot.
Proposed direction
Extend the existing read regions, without adding a new mechanism:
statements whose initializers are pure operator, || and comparison trees over reads of up to 2 receivers, with no calls;
one shape guard per receiver, covering up to MAX_KEYS keys;
cellsConflict is also not inlined into conflictExists: it has 11 statements, above MAX_INLINE_STMTS = 10. This is being measured separately.
Witness: the cli-table3 layout micro (layout-micro.ts in lane perry-wgperf), and walletguide's transactions list --limit 2000 --table (8.1 s vs Node's 1.09 s). Details are in secret-tests scratchpad/shape-audit/AUDIT.md, section 2(a) and step 3.
Activity