mirror of
https://github.com/penpot/penpot.git
synced 2026-10-30 06:20:32 +00:00
The transact path spends its time resolving one tempid per entity, not inserting datoms: the 2026-08-21 retrofit added 48 per cent more datoms for no extra time. datascript's init-db skips that resolution and builds the B-trees from sorted arrays, and build-tx already mints deterministic string tempids from document ids, so assigning final entity ids is one interning pass over the transaction. On the 21,218-shape design system, measured back to back in one warm JVM: 410 ms against 2,150 ms for the same 217,598 datoms. The graphs are the same graph. Entity ids differ and carry no meaning, and the datom sets are identical once every id is read back through the tempid that minted it, which the new test asserts along with the stats and the edge counts. This is sound only while every build transform reads the document rather than the half-built index, because init-db has no index to read. The existing transforms all do: euler-numbering walks :objects, ref-resolver goes through ctf/find-ref-shape, and the asset maps come from :data. backend suite unchanged at 161 pre-existing failures (media and storage, unrelated), 825 tests and 5495 assertions against 824 and 5491 before.