mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-03 08:51:30 -06:00
A range read during recalculation walked every array laid out in the pass on the sheet, whatever the range, and a block read (visit_range) gave up its fast path as soon as any array was laid out there. A Python cell's cached result can be up to 1,000,000 cells, so 1,000 formulas reading small ranges beside it could visit about a billion values in one full recalculation; a large formula array costs the same. Both reads now look only at the arrays whose area meets the range, and only at the part inside it. The spilled values the sheet stores from the last calculation are found row by row when the range has fewer rows than there are spilled values, so a read beside them doesn't scan them either.