On Bun, the benchmark's loaded year spent 57% of its time scoring
candidate plans. Freezing a 40-element array costs about 50 times the
map that builds it, and a frozen array reads about 12 times slower.
- The lists that plan observations build per candidate plan are no
longer frozen. Their elements stay frozen and their types readonly;
work sequences reuse one frozen object per distinct sequence.
- An optimization is scored in one loop, without intermediate arrays.
Balance and placement observations are built on first read, a
TIME_WINDOW preference stops counting at its requested quantity, and
the expiry tie-break sorts without a comparator.
- A finalized candidate's objective vector no longer counts unsatisfied
obligations again. The retained plan's state key is built once. An
earned entitlement's merged period is found without materializing
every period, and its date arithmetic runs once per period.
- A candidate already worse on a protected objective is still rejected
before finalization when a rule can earn leave, as long as finalizing
it cannot touch an earned balance. Samedi Malin used to switch this
pruning off.
Loaded year 6.31 s to 2.70 s, three years 3.55 s to 1.66 s, two years
1.10 s to 0.54 s. Every outcome, stable explanation and final state is
unchanged: the frozen-engine differential check passes, and 26 requests
of one to four years match the previous engine, cancelled runs included.
The benchmark budgets follow at about 1.5 times the new ratios. The
record lists four search behaviors found on the way and left as they
are (#347, #348, #349, #350).
Closes#321
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>