penpot/common/dev/bench/component_sync_baseline.edn
alonso.torres 680b08dcaf ✨ Make composable interpreter steps wait for pending work
The composable interpreter treated a step as done after a 60 ms gap
with no commits, and treated its 2 s timeout as done too. Slow sync or
reflow work could finish after the step, so a case could assert on a
half-synced file.

Each event step now waits, as the plugin waitForLayoutUpdate does,
until every pending work tracked by the reflow registry has drained:
the watcher's sync wait, the sync it starts, and layout and text
reflow. A step that does not drain within 2 s fails the test and names
the work still pending, and the next variant starts with nothing
pending.

The tests cover an edit with a deliberately slow sync, undo and redo
steps that must wait for the watcher's touch-component, translation
and derived commits, a sync that never finishes, and a restart of the
edit watchers, which must keep the undo entries of an edit the same.

Also in this commit:

- Keep page-less changes from adding a nil page. Applying a commit locally
  rebuilds the object indices of every page its changes name. Changes that touch
  no page, such as :mod-component, name none, and their nil page id was rebuilt
  too: the file data in the store gained a page under a nil key holding
  {:objects nil}. Every component touch after an edit to a main added it, and
  undo never removed it.
- Check undo and redo of every step in the composable cases. The composable
  cases tested undo only where a case asked for it, so a change generator with a
  wrong inverse, or a step that splits into several undo entries, went
  unnoticed.
- Add operations and cases to the composable component suites. The composable
  runners could edit, add, remove and move children, swap and switch, but not
  run the other component operations.
- Test component validation, repair and library asset sync.
- Add a component sync benchmark with a recorded baseline. The coming refactors
  and fixes change sync code, and a slowdown must be seen and explained in the
  commit that causes it.
- Tidy the composable suite and make its cases stricter.
- Test the component sync paths no test reached. A coverage run found sync paths
  that no test ran.
- Test variant events, token sync and switch overrides. The variant events had
  almost no frontend tests, and several switch, paste, token and restore paths
  never ran.
- Test the file and container helpers and the library events. The component
  helpers of types/file and types/container and the library events of the
  workspace had the lowest coverage left.
2026-11-10 20:21:15 +01:00

24 lines
835 B
Clojure

;; Component sync benchmark baseline, written by `scripts/bench-components record`.
{:commit "1e6615a132",
:date "2026-10-09",
:machine
{:cpu "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
:cores 12,
:os "Linux amd64",
:jvm "26.0.2"},
:results
{:deepest-edit-through-three-levels
{:mean-ms 36.343, :lower-q-ms 35.215, :passes 4},
:edit-through-a-chain-of-dependents
{:mean-ms 75.119, :lower-q-ms 68.931, :passes 3},
:library-update-into-copies
{:mean-ms 89.295, :lower-q-ms 83.083, :passes 1},
:main-edit-into-10-copies
{:mean-ms 1.847, :lower-q-ms 1.79, :passes 1},
:main-edit-into-100-copies
{:mean-ms 16.234, :lower-q-ms 15.415, :passes 1},
:main-edit-into-1000-copies
{:mean-ms 158.728, :lower-q-ms 153.086, :passes 1},
:variant-switch-into-copies
{:mean-ms 33.1, :lower-q-ms 32.052, :passes 1}}}