Commit f3ee2a8
perf: right-size register tuple allocations
Replace the hard-coded 256-register top-level allocation and the
+64 over-allocation on every callee call with values derived from
the prototype's max_registers field.
- vm.ex: proto.max_registers + 16 (was 256)
- executor.ex: max(max_registers, param_count) + 16 (was + 64)
The +16 buffer accounts for multi-return expansion slots that the
codegen doesn't always track in max_registers. This cuts register
tuple waste significantly for recursive workloads like fib(N).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 56d0501 commit f3ee2a8
2 files changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | | - | |
| 1107 | + | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | 1110 | | |
| |||
0 commit comments