[]previous and next page

Measuring

Measure the work caused by an interaction and the time it takes on your target devices.

For agentsUpdated

Measure the work caused by an interaction and the time it takes on your target devices.

  • Binding runs: increment a counter inside the expression, as above.
  • DOM mutations: a MutationObserver with takeRecords() after flushSync().
  • Node creation: spy on Node.prototype.cloneNode and Document.prototype.createElement.
  • Row creation and disposal: counters in the row component and its onCleanup.

For wall-clock numbers use your browser's profiler on a production build, or the repository's row benchmark (below). For a view of signals, effects and updates in a running app use @shadow-js/devtools. Besides the row benchmark, the repository has benchmarks/micro/run.mjs (npm run bench -w @shadow-js/bench-micro, after npm run build -w @shadow-js/core). It compares @shadow-js/core with Solid 1.9 on identical graph workloads and prints the median of seven runs for:

Scenario What it stresses
create 100k signals allocation
write 1 signal, 10k effects, 20 times fan-out of one write
memo chain depth 1000, 200 updates deep dependency chains
diamond fan 1000 wide, 200 updates wide fan-in and glitch-free ordering
dynamic deps toggle, 20k updates dependency re-tracking
create and dispose 50k effects ownership and teardown

docs/STATUS.md records the result as on par with or faster than Solid 1.9 on these workloads; the figures depend on your machine, so run the script instead of quoting a number. It measures the reactive core only, not DOM rendering.