mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 14:06:09 +00:00
appearance.setItem, appearance.duplicateItem and fill and stroke edits aimed at a row (`item`) keep, for graph labels and lines, the objects whose shown row the edit wrote. Each object was looked up in a list of the written objects, so that step took time that grows with the square of the number of objects. The written objects are now collected into a set first. The objects kept, their order and the rows a graph keeps are the same. crates/engine/examples/appearance_rows_bench.rs times both lookups on the same ids in one process and the whole commands. With 20,000 squares, each command given every square's id, the lookup takes 0.4 ms of thread CPU time on Linux against 57 ms, and appearance.setItem takes 96 ms against 158 ms. At 2,000 objects the difference is about 2 ms.