raz / commit 3623192c

commit
3623192c2c024bcc0ba277b9a4ca57d8efde5034
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
9ee13778
PLAN: inline, measured on rat; the hint dropped

patch · log

1 file changed, +15 -2

PLAN.md (history) modified +15 -2

@@ -80,5 +80,18 @@
8080 time, since the loop's values then stay in registers, not the
8181 frame; FPC `-O2` with `inline` gains as much. `tools/Pretty` gained
8282 nothing: its small procedures cost their work, not their calls.
83- Open: where gdb and a failure place a line inside an inlined
84- procedure, the callee's or the caller's.
83+ Dropped as a language change (2026-10-13): a hint means nothing a
84+ program can see, and this compiler can inline by itself, with no
85+ keyword. Debugging would be settled by keeping the callee's lines
86+ in the line table as rows that aren't statements (DWARF's
87+ `is_stmt`): gdb steps over them, `Rt` still tells a failure at its
88+ expression; only `Rt.trace` loses the callee's frame.
89+ Measured on rat's 26 MB workload (477 ms): its hot procedures are
90+ almost never a single `return e`, and inlining those by hand gained
91+ nothing. What did gain, 12%, was hoisting the fast path of two small
92+ procedures into their callers by hand: `Width.cells` (`if c < 300H
93+ then return 1`) and `Screen.unsplit` (a guard, then rare work),
94+ called for every character. An inliner for that, statements and
95+ early returns and procedures without results, is several times the
96+ size; the same 12% is a few lines in rat. Revisit only if more
97+ programs show it.