For the complete documentation index, see llms.txt. This page is also available as Markdown.

Optimization order

1. Establish measurements

Record bytecode size, variable use, stack warning/result, VM load, and the behavior test matrix.

2. Remove unused const data

Strings, images, and tables consume bytes even if no live code references them.

3. Narrow const widths

Apply compiler suggestions when signedness/range remain correct.

4. Cache and dirty-gate

Stop full scans and feedback rendering every cycle.

5. Consolidate duplicate executable logic

Use a function when repeated body size is larger than call overhead and the boundary improves clarity.

6. Flatten stack-heavy expressions

temp1 = a * b;
temp2 = c * d;
result = temp1 + temp2;

7. Recompile and regression-test

After every meaningful reduction, retest input layers, output order, persistence, menus/gates, and boundary values.

Last updated