mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
A page whose fragment id main shares with the branch's base holds the same document on both sides, because a fragment row never changes after it is written. The derive now hands back the fragment ids of the base pages, and a comparison loads only the pages of main whose id differs: the base's realized page stands in for every other page. The direction that reports main's changes (the compare's main->branch and the reverse pass of the diff counts) is bounded to those pages with :only-pages. A base that was migrated, or that holds no pointers, gives no ids and keeps the whole-file comparison. On a copy of the scaling corpus rung L7 (69 pages, 47,514 objects) the main->branch compare drops from 5,690 ms to 1,965 ms and the branch->main compare from 3,254 ms to 1,981 ms; what remains is the branch derive, which still realizes the whole base. The compare's size gate now runs after the derive, because main's document is assembled from the base. The depth gate still runs before it, and the base passed the size gate when it was written. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>