mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-30 05:16:56 -06:00
Every replica placed a created, moved or reordered layer by counting each sibling that sorts before it, so a batch of many layers under one parent took quadratic time, on the server's single hub thread too. `Replica::slot` now binary-searches the `(key, id)` order on each side of the layer's old place (a position change has already given it its new key). The order is unchanged, ties and fractional positions included. 20,000 creations and 10,000 moves under two parents: 20.05 s before, 0.33 s after (debug build). Fixes #1065