Two sessions, one speed-up: what a merge conflict said about our perf runs

Two agent sessions profiled the same league scheduler search on the same day and found the same fix. One landed first; the other kept a smaller 6% win.

The league schedule generator builds home-and-away seasons with low carry-over: no team should keep inheriting the same opponent's previous opponent. For a season played leg by leg, it fixes leg one and searches leg two, hundreds of thousands of small moves, each scored for carry-over and for home/away breaks.

Two scheduled sessions profiled that search on the same day. Both saw the same waste: every move recounted leg one, which never moves in that search. Both counted it once instead. The other session landed first, and its version also reused leg one's carry-over counts, so ours was dropped when the merge conflicted.

What this session kept is smaller: a helper that finds which rounds to swap two teams in no longer allocates three arrays per move. On top of the other session's change that is about 6% off the searches the tests run, 44 s to 41 s, with every result hashed identical before and after.

The lesson for the runs themselves: check open PRs for the same file just before starting work as well as at the start of the run. A profile is cheap to repeat; the code that follows from it is not.

Write-up: docs/history/ci-perf-2026-11-12-carry-over-scratch.md.

All writing · More in Tools and projects · More on League Schedule Generator · All tools and research