@zakkster/lite-signal 1.5.0-alpha.1 → 1.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/README.md +129 -44
- package/llms.txt +77 -27
- package/package.json +24 -7
package/CHANGELOG.md
CHANGED
|
@@ -139,6 +139,61 @@ survives consumer re-runs.
|
|
|
139
139
|
cleanly -- detachment costs no auto-cleanup but introduces no leak. Verified
|
|
140
140
|
against the exact lazy-watcher pattern `lite-query` uses.
|
|
141
141
|
|
|
142
|
+
### Added -- VersionMatrix identical-code guard (harness/VersionMatrix/)
|
|
143
|
+
|
|
144
|
+
The regression gate (`harness/VersionMatrix/`, wired into `prepublishOnly` since
|
|
145
|
+
1.4.0) gains an **identical-code guard**: each capture records the sha256 of the
|
|
146
|
+
engine source (`baselines/<label>/engine.sha256`). If the candidate's hash matches
|
|
147
|
+
a baseline's, that axis is running the *same bytes* -- any measured delta is host
|
|
148
|
+
noise, not a regression -- so the gate marks it `SKIP` rather than let variance
|
|
149
|
+
flag a phantom. This is what saves you when you re-version without a code change:
|
|
150
|
+
a `1.5.0-beta.0` that is byte-identical to a published `1.5.0-alpha.1` cannot
|
|
151
|
+
regress against it, and the gate says so structurally instead of failing on a
|
|
152
|
+
noisy median. Genuine code changes produce a different hash and are gated
|
|
153
|
+
normally. Everything else about the harness -- cold-process-per-version,
|
|
154
|
+
LCG-deterministic input, two baselines (floor `1.3.0` + rolling), calibrated
|
|
155
|
+
tolerances (`frame.avg` 5% rolling / 10% floor, `frame.p99` and `phase.write.p99`
|
|
156
|
+
18% / 30%), four workloads mapping to public bench claims -- carries forward
|
|
157
|
+
from 1.4.0. Details in `harness/VersionMatrix/README.md`.
|
|
158
|
+
|
|
159
|
+
### Verified -- fresh 1.5.0-beta bench sweep
|
|
160
|
+
|
|
161
|
+
Both benches were re-run in full on the 1.5.0-beta engine and their outputs
|
|
162
|
+
committed to `bench/results.txt` (isolated propagation, 9 scenarios) and
|
|
163
|
+
`bench/resultsReactive.txt` (cross-framework reactivity, median-of-10, 34
|
|
164
|
+
tests). The 10 raw reactive-suite runs sit under `bench/bench-runs-reactive/
|
|
165
|
+
run_1.txt` ... `run_10.txt` so anyone can re-median independently.
|
|
166
|
+
|
|
167
|
+
- **Propagation bench (results.txt):** lite +48% / +45% / +33% / +29% on the four
|
|
168
|
+
allocation-heavy scenarios (SELECTIVE DAG / DYNAMIC DAG / MUX / SMALL
|
|
169
|
+
SELECTIVE); **LARGE WEB APP flipped into a small lite win (+2%, from -3% on
|
|
170
|
+
1.4.0)** after the alien-signals 3.1.2 -> 3.2.1 bump between sweeps; parity on
|
|
171
|
+
WIDE DENSE (-6%) and KAIROS (-7%); alien ahead on BROADCAST (-12%) and DEEP
|
|
172
|
+
CHAIN (-14%, narrowed from -29% on 1.4.0 for the same alien-version reason
|
|
173
|
+
-- lite's DEEP CHAIN barely moved, 395 -> 398ms). Speed wins vs alien: **5/9**
|
|
174
|
+
(was 4/9); heap wins: 8/9.
|
|
175
|
+
- **Reactive suite (resultsReactive.txt):** fastest of five frameworks on all
|
|
176
|
+
five `dyn` rows (simple +19%, dynamic +16%, large web app +9%, wide dense +6%,
|
|
177
|
+
deep +12%), and **lite now leads alien on ALL 7 `S: updateComputations` rows**
|
|
178
|
+
this sweep (+3% / +6% / +3% / +12% / +3% / +2% / +8%; was 4/7 on 1.4.0).
|
|
179
|
+
- **Andrii Volynets js-reactivity-benchmark position holds at 4th of 15** with
|
|
180
|
+
geomean **79.3ms** (raw log `bench/AndriiVolynetsReactiveBench.log`); lite is
|
|
181
|
+
ahead of 5th-place Preact Signals (99.8) by ~21% -- the gap widened this
|
|
182
|
+
sweep after Preact's own regression on the newer 1.14.2. Top-3 count moved
|
|
183
|
+
from 21/47 (1.3.0 log) -> 23/47 (1.4.0 log) -> **25/47 (1.5.0-beta log)**;
|
|
184
|
+
outright-fastest-of-15 wins fluctuate at the top of a very tight leaderboard
|
|
185
|
+
where alien-signals / reflex / lite trade sub-percent margins per shape (5
|
|
186
|
+
outright wins on 1.4.0, **2 outright wins on 1.5.0-beta** -- `createComputations4to1`
|
|
187
|
+
and `1000x5 - 25 sources (wide dense)`). The stable metric across every
|
|
188
|
+
published sweep is the geomean rank at #4 of 15.
|
|
189
|
+
- **Third-party version bumps** used in this sweep vs 1.4.0: alien-signals
|
|
190
|
+
3.1.2 -> 3.2.1, @preact/signals-core 1.14.1 -> 1.14.2, @vue/reactivity
|
|
191
|
+
3.5.13 -> 3.5.35, solid-js 1.9.12 -> 1.9.13. Any within-lib delta between
|
|
192
|
+
the two sweeps reflects those bumps + host noise, not lite-signal changes:
|
|
193
|
+
1.4.0 -> 1.5.0 hot-path bytes are byte-identical (1.5.0 adds only the
|
|
194
|
+
non-callable box handle shape, which affects construction cost and handle
|
|
195
|
+
ergonomics but not the pooled-node read/write path).
|
|
196
|
+
|
|
142
197
|
## [1.4.0] -- 2026-06-XX
|
|
143
198
|
|
|
144
199
|
The observability minor: `stats()` gains **three cumulative lifecycle counters**
|
|
@@ -195,6 +250,31 @@ with the rest of registry state, so a reused registry reports lifecycle numbers
|
|
|
195
250
|
for its current epoch only. Grown pool *capacity* is retained across `destroy()`
|
|
196
251
|
as before (the reset keeps the arena warm); only the cumulative counts reset.
|
|
197
252
|
|
|
253
|
+
### Added -- VersionMatrix regression gate (harness/VersionMatrix/)
|
|
254
|
+
|
|
255
|
+
A **same-host, cold-process regression gate** for the engine ships alongside the
|
|
256
|
+
observability counters, wired into `prepublishOnly` -- a candidate that regresses
|
|
257
|
+
beyond calibrated tolerances aborts `npm publish` before it starts. Each
|
|
258
|
+
version-x-workload is profiled in its own `node` invocation (V8 never carries
|
|
259
|
+
inline caches or JIT state across versions), fed an identical LCG write sequence
|
|
260
|
+
(delta = engine change, not input), and reduced to a per-metric median-of-N
|
|
261
|
+
(default 5). **Two baselines** gate every publish: a **floor** (never moves;
|
|
262
|
+
"we shall not regress below this line") and a **rolling** baseline (previous
|
|
263
|
+
published version); a candidate must clear BOTH. Tolerances calibrated against
|
|
264
|
+
measured self-noise (`npm run calibrate`): `frame.avg` is the stable anchor at
|
|
265
|
+
5% vs rolling / 10% vs floor (self-noise <=~3%); `frame.p99` and
|
|
266
|
+
`phase.write.p99` sit at 18% / 30% (self-noise up to ~14%, so a p99 fail should
|
|
267
|
+
be re-run to confirm). Four workloads map to public bench claims:
|
|
268
|
+
`reactive-graph-mix` (KAIROS / mol pattern), `deep-chain` (the DEEP CHAIN weak
|
|
269
|
+
spot), `broadcast-fanout` (the BROADCAST fan-out), and `dynamic-dep-churn` (the
|
|
270
|
+
DYNAMIC / SELECTIVE DAG wins). Committed median baselines under
|
|
271
|
+
`harness/VersionMatrix/baselines/` are the public evidence surface (each
|
|
272
|
+
carrying `env` metadata: CPU, node, date); the gate itself always re-captures
|
|
273
|
+
floor / rolling / candidate in the same job so it never diffs across hosts.
|
|
274
|
+
Manifest at `manifest.json` pins the floor (`1.3.0`), the rolling reference, and
|
|
275
|
+
the workload list. Details in `harness/VersionMatrix/README.md`. (The 1.5.0-beta
|
|
276
|
+
identical-code guard extending this gate lands in the 1.5.0 entry above.)
|
|
277
|
+
|
|
198
278
|
### Verified
|
|
199
279
|
|
|
200
280
|
- **Full suite green** against the 1.4.0 engine: 429 tests, 419 pass, 0 fail,
|
package/README.md
CHANGED
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
## 4th of 15 on the community reactivity benchmark -- and the only zero-GC engine in the field
|
|
17
17
|
|
|
18
|
-
On the independent [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (Andrii Volynets' fork; 15 reactive libraries, 47 tests), `lite-signal` places **4th overall by geomean (
|
|
18
|
+
On the independent [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (Andrii Volynets' fork; 15 reactive libraries, 47 tests), `lite-signal` places **4th overall by geomean (79.3ms)** -- ahead of 5th-place Preact Signals (99.8) by ~21%, behind only three push-eager engines: alien-signals (45.2), reflex (48.9), and @reactively (59.9). Raw log: [`bench/AndriiVolynetsReactiveBench.log`](./bench/AndriiVolynetsReactiveBench.log) (all 15 x 47 rows, checked in for audit).
|
|
19
19
|
|
|
20
20
|
It is the **only object-pooled, zero-GC engine in the entire field**, and it gets that result without giving up glitch-freedom or lazy evaluation. Against the mainstream reactivity libraries it leads decisively:
|
|
21
21
|
|
|
22
|
-
| vs | lite-signal is |
|
|
22
|
+
| vs | lite-signal is |
|
|
23
23
|
| ---------------------- | -------------- |
|
|
24
24
|
| **@vue/reactivity** | **1.5x faster** |
|
|
25
25
|
| **Signia** | **1.7x faster** |
|
|
26
|
-
| **MobX** | **2.
|
|
27
|
-
| **@solidjs/signals** | **
|
|
28
|
-
| **SolidJS** | **4.
|
|
29
|
-
| Preact Signals | **1.
|
|
30
|
-
| alien-signals | 0.
|
|
26
|
+
| **MobX** | **2.2x faster** |
|
|
27
|
+
| **@solidjs/signals** | **3.2x faster** |
|
|
28
|
+
| **SolidJS** | **4.6x faster** |
|
|
29
|
+
| Preact Signals | **1.26x faster** (~21% ahead) |
|
|
30
|
+
| alien-signals | 0.57x (the field leader) |
|
|
31
31
|
|
|
32
|
-
`lite-signal` finishes **top-3 on
|
|
32
|
+
`lite-signal` finishes **top-3 on 25 of the 47 tests** (up from 23 on the 1.4.0 sweep) and, on this specific run, is **outright fastest of all 15** on two shapes -- `createComputations4to1` (a computed-creation micro where lite narrowly edges alien 7.08ms vs 7.10ms) and the `1000x5 - 25 sources (wide dense)` rectangular DAG (the "wide dense" web-app shape). It comes second on nine more shapes -- `broadPropagation`, `diamond`, `repeatedObservers`, `unstable` propagation, `manySourcesIntoOneComputedEffect` (fan-in), `manySourcesIntoOneDirectEffect`, `molBench` (mixed app graph), the `32x8 - 4 sources - pull` DAG, and the `10x5 - 2 sources - read 20%` simple-component shape. The outright-win count fluctuates between runs at the top of a very tight leaderboard (reflex and alien-signals swept several wide-aggregation shapes on this run that lite held on the 1.4.0 sweep); the stable metric is the geomean rank, which has held at 4th of 15 across every published sweep. The three engines ahead of it are all push-eager designs that allocate on the hot path; `lite-signal` is the only top-4 finisher that allocates **nothing** in steady state. (Note: this suite measures reactivity *libraries* -- Vue's reactivity core, MobX, Solid, Preact Signals, etc. -- not full UI frameworks like React or Angular.)
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
npm install @zakkster/lite-signal
|
|
@@ -65,6 +65,7 @@ Synchronous, glitch-free, push-pull. No microtask queue, no allocations after wa
|
|
|
65
65
|
- [Edge cases pinned down](#edge-cases-pinned-down)
|
|
66
66
|
- [Benchmarks](#benchmarks)
|
|
67
67
|
- [Testing strategy](#testing-strategy)
|
|
68
|
+
- [Test harnesses](#test-harnesses)
|
|
68
69
|
- [What this is not](#what-this-is-not)
|
|
69
70
|
- [Ecosystem](#ecosystem)
|
|
70
71
|
- [Browser and runtime support](#browser-and-runtime-support)
|
|
@@ -695,25 +696,25 @@ These are the questions you'd ask in a code review, with the answers:
|
|
|
695
696
|
|
|
696
697
|
## Benchmarks
|
|
697
698
|
|
|
698
|
-
Honest numbers, against the same workload, with anti-DCE sinks and verified effect execution. All measurements: Node 22, **2016-era Intel MacBook Pro (4 cores, ~10 yr old hardware)**, **one engine per cold process**, median across reps. Newer/faster machines shift all libs up proportionally; the relative ordering between libs is what matters. Numbers below are
|
|
699
|
+
Honest numbers, against the same workload, with anti-DCE sinks and verified effect execution. All measurements: Node 22, **2016-era Intel MacBook Pro (4 cores, ~10 yr old hardware)**, **one engine per cold process**, median across reps. Newer/faster machines shift all libs up proportionally; the relative ordering between libs is what matters. Numbers below are the **fresh 1.5.0-beta bench sweep** (default `prealloc: "eager"`) vs alien-signals on the same `benchmark.mjs` loop -- the harness reports **median execution time + transient heap** rather than ops/s. 1.5.0's hot paths are byte-identical to 1.4.0 (1.4.0 added three `stats()` counters on existing acquire/dispose/pool-grow edges; 1.5.0 adds the `signalBox` / `computedBox` non-callable handle shape -- cheaper CONSTRUCTION, same pooled-node read/write path -- and `createRoot`, an ownership escape hatch not on the hot path), so steady-state throughput tracks the 1.4.0 measurement within run-to-run noise on this old host. The third-party engine versions used in this sweep bumped from the 1.4.0 sweep (alien-signals 3.1.2 -> 3.2.1, @preact/signals-core 1.14.1 -> 1.14.2, @vue/reactivity 3.5.13 -> 3.5.35, solid-js 1.9.12 -> 1.9.13), so any within-lib delta between the two sweeps reflects those bumps + host noise, not lite-signal changes. Full per-engine tables: [`results.txt`](bench/results.txt) (this propagation suite) and [`resultsReactive.txt`](bench/resultsReactive.txt) (the cross-framework reactivity suite). The 10 raw reactive-suite runs are checked into [`bench/bench-runs-reactive/`](./bench/bench-runs-reactive/) so anyone can re-median them independently.
|
|
699
700
|
|
|
700
701
|
| Scenario | What it stresses | lite-signal | alien-signals | lite vs alien | transient heap (lite / alien) |
|
|
701
702
|
| ---------- | -------------------------------- | ----------- | ------------- | ------------- | ----------------------------- |
|
|
702
|
-
| **SELECTIVE DAG** | sqrt-layered, set churn, 2 read/iter | **
|
|
703
|
-
| **DYNAMIC DAG** | sqrt-layered, FAN=6, read flips each iter | **
|
|
704
|
-
| **MUX** | 256 signals -> 1 sum -> 1 effect (fan-in) | **67 ms** |
|
|
705
|
-
| **SMALL SELECTIVE** | 6 layers × 64 wide, 6 cand / 3 read | **
|
|
706
|
-
| **
|
|
707
|
-
| **
|
|
708
|
-
| **
|
|
709
|
-
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) |
|
|
710
|
-
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect |
|
|
703
|
+
| **SELECTIVE DAG** | sqrt-layered, set churn, 2 read/iter | **4757 ms** | 9166 ms | **+48% faster** | **1.7 MB / 31 MB** (18x less) |
|
|
704
|
+
| **DYNAMIC DAG** | sqrt-layered, FAN=6, read flips each iter | **9630 ms** | 17375 ms | **+45% faster** | **4.3 MB / 26 MB** (6.0x less) |
|
|
705
|
+
| **MUX** | 256 signals -> 1 sum -> 1 effect (fan-in) | **67 ms** | 101 ms | **+33% faster** | **38 KB / 3.9 MB** (104x less) |
|
|
706
|
+
| **SMALL SELECTIVE** | 6 layers × 64 wide, 6 cand / 3 read | **1940 ms** | 2745 ms | **+29% faster** | **0.3 KB / 25.9 MB** (>=25872x less) |
|
|
707
|
+
| **LARGE WEB APP** | 12 layers × ~80 wide, conditional reads | **2800 ms** | 2845 ms | **+2% faster** | **0.3 KB / 41 KB** (41x less) |
|
|
708
|
+
| **WIDE DENSE** | 5 layers × ~200 wide, dense fan-in | 2870 ms | 2719 ms | -6% (parity) | **0.3 KB / 11.6 MB** (>=11605x less) |
|
|
709
|
+
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect | 1418 ms | 1327 ms | -7% (parity) | 178 KB / 1.0 MB (5.9x less) |
|
|
710
|
+
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) | 1210 ms | 1084 ms | -12% | 72 KB / 21 KB |
|
|
711
|
+
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 398 ms | **349 ms** | -14% | 18 KB / 1.8 MB (96x less) |
|
|
711
712
|
|
|
712
713
|
*(lower time = faster; transient heap = average delta-heap per rep, lower = less GC pressure)*
|
|
713
714
|
|
|
714
|
-
**Reading the table:** lite-signal's time wins cluster exactly where its zero-GC design pays off -- the **allocation-heavy dynamic shapes** (**SELECTIVE DAG +48%**, **DYNAMIC DAG +
|
|
715
|
+
**Reading the table:** lite-signal's time wins cluster exactly where its zero-GC design pays off -- the **allocation-heavy dynamic shapes** (**SELECTIVE DAG +48%**, **DYNAMIC DAG +45%**, **SMALL SELECTIVE +29%**), where alien-signals churns the nursery and lite's object pool allocates near-nothing, plus **MUX +33%** (fan-in aggregation). These are the patterns that dominate live UI workloads under input churn: dashboards, scoreboards, HUDs, leaderboards. **LARGE WEB APP** flipped in lite's favor this sweep (+2%, from -3% on 1.4.0 -- alien 3.2.1 slightly slower on this shape than 3.1.2 was); on a ~2800ms base the sign of that parity result depends on the third-party version being measured against. On the cheap, low-allocation **stable** shapes (KAIROS, WIDE DENSE) lite runs at **parity** with alien -- within a 6-7% band inside this old host's run-to-run noise. The two losses are **BROADCAST (-12%)** (pure fan-out, no retracking for the pool to amortize) and **DEEP CHAIN (-14%)**: on a 256-deep computed pipeline alien's flatter representation still wins, though the gap narrowed considerably from -29% on the 1.4.0 sweep because alien-signals 3.2.1 got slower on the 256-deep shape than 3.1.2 was; lite's DEEP CHAIN barely moved between sweeps (395 -> 398ms).
|
|
715
716
|
|
|
716
|
-
On allocation pressure, `lite-signal` wins **8 of 9 scenarios** and is alone in the zero-alloc band: **~0.3 KB** of transient garbage on the stable app shapes (large web app, wide dense, small selective) across the whole run. The contrast is starkest on the dynamic DAGs -- lite allocates 1.
|
|
717
|
+
On allocation pressure, `lite-signal` wins **8 of 9 scenarios** and is alone in the zero-alloc band: **~0.3 KB** of transient garbage on the stable app shapes (large web app, wide dense, small selective) across the whole run. The contrast is starkest on the dynamic DAGs -- lite allocates 1.7-4.3 MB (genuine retracking re-links) where alien-signals allocates 26-31 MB on the same shapes, and that allocation gap is the mechanism behind lite's +45-48% wins there once each engine is measured in isolation. On DEEP CHAIN, alien's transient heap moved from ~903 KB (with alien 3.1.2) to ~1.8 MB (with alien 3.2.1), further widening the heap gap to ~96x -- lite's 18 KB on the same shape is unchanged. The one scenario where lite allocates more is **BROADCAST** (72 KB vs alien's 21 KB), a pure fan-out with no retracking. `prealloc: "lazy"` trades a little extra first-construction allocation on the dynamic shapes for a smaller resident heap and faster cold start; the steady state is identical. preact and solid trail both engines on the dynamic shapes by 1-2 orders of magnitude on transient heap.
|
|
717
718
|
|
|
718
719
|
> Note on the +70.8 KB retained that lite-signal shows on KAIROS specifically: that's the pre-allocated pool sitting in memory holding the live graph (1002 nodes + ~2000 links). The pool *is* the working memory -- see the [Case for object pooling](#case-for-object-pooling) section. On the other benches the graph is small enough that the same pool floats below baseline after GC.
|
|
719
720
|
|
|
@@ -821,10 +822,91 @@ npm run verify # test + test:gc + a sanity bench
|
|
|
821
822
|
|
|
822
823
|
---
|
|
823
824
|
|
|
825
|
+
## Test harnesses
|
|
826
|
+
|
|
827
|
+
Beyond the engine's own test tiers above, `@zakkster/lite-signal` ships **dedicated harnesses** that live in their own subdirectories with their own `package.json` and setup story. They are version-portable, integration-grade, or otherwise too specialised to belong in the in-tree engine suite -- and they are explicitly opt-in for the two run-on-demand harnesses; the VersionMatrix regression gate is wired into `prepublishOnly` so it runs automatically on `npm publish`. Each is a self-contained artifact you can run against any installed engine, or carry into a different repo to verify a claim independently.
|
|
828
|
+
|
|
829
|
+
This section will grow. As future versions ship publications that need specific defensive validation (e.g. a `flushStrategy` ship, a TC39-polyfill ship, a zero-GC public gate, a profiler/observability ship), the corresponding harness lands here.
|
|
830
|
+
|
|
831
|
+
### `test/ProfilerTests/` -- version-portable hardening suite
|
|
832
|
+
|
|
833
|
+
An adversarial, **version-portable** conformance + hardening suite for `@zakkster/lite-signal`. `node:test` only, zero test deps. Each file imports the **bare** package (`@zakkster/lite-signal`), so it resolves to whatever version is installed when run standalone, and self-references through this repo's own package name when run inside the source tree. Advanced cases are **feature-gated**: an older engine skips the cases for APIs it does not have yet, and they light up automatically as the surface grows.
|
|
834
|
+
|
|
835
|
+
Pins the invariants that quietly break reactive engines: glitch-freedom on diamonds, dropping the untaken branch on dynamic dependencies, keeping unobserved computeds lazy, cleanup order, surviving a throwing effect, no leaks under churn, cascade-disposing an ownership scope. The same cases worth asking about in an interview, and the same ones that regress when an engine is re-tuned for speed.
|
|
836
|
+
|
|
837
|
+
```bash
|
|
838
|
+
# Against the local engine (self-references through the root package name):
|
|
839
|
+
npm run test:hardening
|
|
840
|
+
npm run test:hardening:gc
|
|
841
|
+
|
|
842
|
+
# Standalone, against any published version (run from inside test/ProfilerTests):
|
|
843
|
+
cd test/ProfilerTests
|
|
844
|
+
./run-matrix.sh # tests every published line
|
|
845
|
+
./run-matrix.sh 1.3.0 1.4.0 1.5.0-beta.0 # pick versions explicitly
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
The matrix is **ratcheted stricter every release**: a regression in a future version fails loudly, instead of shipping. The README inside the suite (`test/ProfilerTests/README.md`) records the current pass/skip table per published line.
|
|
849
|
+
|
|
850
|
+
### `harness/VersionMatrix/` -- cold-process performance gate
|
|
851
|
+
|
|
852
|
+
A **same-host, cold-process regression gate** for the engine. Turns "did this release regress?" from a judgment call into a checkpoint: the driver swaps each engine version into `node_modules` in its own `node` invocation (so V8 never carries inline caches or JIT state from one version into another), feeds every version an identical LCG write sequence (so a delta is the engine changing, not the input), and reduces N cold samples per version-x-workload to a per-metric median. Wired as `prepublishOnly` -- a regression aborts `npm publish` before it starts.
|
|
853
|
+
|
|
854
|
+
**Two baselines.** A candidate must clear BOTH a **floor** (never moves -- "we shall not regress below this line") AND a **rolling** baseline (the previous published version). Tolerances are calibrated against measured self-noise (`npm run calibrate`): `frame.avg` is the stable anchor (self-noise <=~3%, gated tight at 5% vs rolling / 10% vs floor); `frame.p99` and `phase.write.p99` are jitter-prone (self-noise up to ~14%), so their tolerances sit above that floor (18% rolling / 30% floor) and a p99 fail should be confirmed with a re-run. The two-baseline design catches the blind spot of a fixed floor -- an engine that improves 1.4 -> 1.6 then regresses back to 1.4 levels still clears a 1.3 floor, but fails the rolling gate.
|
|
855
|
+
|
|
856
|
+
**Identical-code guard (new in 1.5.0-beta).** Each capture records the sha256 of the engine source (`baselines/<label>/engine.sha256`). If the candidate's hash matches a baseline's, that axis runs the *same bytes* -- any measured delta is host noise, not a regression -- so the gate **skips** it (shown as `SKIP`) rather than let variance flag a phantom. This is what saves you when you re-version without a code change: a `1.5.0-beta.0` that is byte-identical to a published `1.5.0-alpha.1` cannot regress against it, and the gate says so structurally instead of failing on a noisy median. A genuine code change produces a different hash and is gated normally.
|
|
857
|
+
|
|
858
|
+
**Four workloads**, each mapping to a public bench claim so a change that regresses one shape can't hide behind another:
|
|
859
|
+
|
|
860
|
+
- `reactive-graph-mix` -- general sources -> layer1 -> layer2 + effects (the KAIROS / mol pattern).
|
|
861
|
+
- `deep-chain` -- long linear computed chain (the DEEP CHAIN weak spot).
|
|
862
|
+
- `broadcast-fanout` -- one source -> many leaves (the BROADCAST pattern).
|
|
863
|
+
- `dynamic-dep-churn` -- branch-flipping bodies that retrack every cycle (the DYNAMIC / SELECTIVE DAG wins).
|
|
864
|
+
|
|
865
|
+
Graphs are sized under lite-signal's default 1024-node pool cap; frame cost is scaled by `ITER` (more update cycles), not more nodes.
|
|
866
|
+
|
|
867
|
+
```bash
|
|
868
|
+
npm run calibrate # self-noise: same version twice, per metric
|
|
869
|
+
bash matrix.sh gate <candidate-version> # published candidate vs floor + rolling
|
|
870
|
+
bash matrix.sh gate-self <label> <path> # current-tree candidate (engine path) vs floor + rolling
|
|
871
|
+
node diff.mjs # diagnostic over committed baselines -> matrix-report.json
|
|
872
|
+
node gate.mjs <label> # gate over already-captured baselines (exit 1 on regression)
|
|
873
|
+
npm run gate # what prepublish runs -- gate-self against the current tree
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
Committed median baselines live under `harness/VersionMatrix/baselines/<version>/*.json` (each carrying `env` metadata: CPU, node, date, and the `engine.sha256`). These are the **public evidence surface** -- anyone can rerun and diff -- but the gate always re-captures floor / rolling / candidate in the same job so it never diffs across hosts. Details, including how to add a new version to the matrix, in [`harness/VersionMatrix/README.md`](./harness/VersionMatrix/README.md).
|
|
877
|
+
|
|
878
|
+
### `harness/ProfilerTools/` -- combined profiler + devtools integration
|
|
879
|
+
|
|
880
|
+
A live cross-package harness that points `@zakkster/lite-profiler-signal` and `@zakkster/lite-devtools` at the **same** lite-signal registry and verifies the integration. `profiler-signal` writes coarse frame telemetry into signals (fps, frameP99, frameClass, per-phase p99); a small dashboard effect reads those signals; `devtools` then inspects that live graph **non-perturbingly** (peek + enumerator walks, never adding an observer) and confirms, via the same `stats()` it monitors, that the profiler allocates no new graph nodes in steady state. This is the externally-runnable proof of the zero-GC contract end-to-end: not just on a microbench, but across the actual published package chain consumers install.
|
|
881
|
+
|
|
882
|
+
```bash
|
|
883
|
+
# One-time setup -- pulls peer deps + the engine version the harness targets:
|
|
884
|
+
cd harness/ProfilerTools
|
|
885
|
+
bash setup.sh
|
|
886
|
+
|
|
887
|
+
# Then:
|
|
888
|
+
npm test
|
|
889
|
+
npm run test:gc
|
|
890
|
+
|
|
891
|
+
# Or from the root:
|
|
892
|
+
npm run test:harness
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
The setup script pins specific package versions via tarball install so the harness can be re-run reproducibly without depending on whatever happens to be in the public registry on the day. Treat the setup as a one-time per-checkout cost.
|
|
896
|
+
|
|
897
|
+
### Notes
|
|
898
|
+
|
|
899
|
+
- The hardening suite and the profiler integration do **not** run on `npm test` from the root. They opt in through the `test:hardening` / `test:harness` scripts (and `test:all`, which chains everything).
|
|
900
|
+
- The **VersionMatrix gate**, by contrast, IS wired into `prepublishOnly` -- a regression on the four reference workloads blocks `npm publish`. Diagnostic runs (`node diff.mjs`) are opt-in from the harness directory.
|
|
901
|
+
- All three subdirectories have their own `package.json` with local scripts, so you can also `cd` in and run `npm test` directly -- the root scripts are just shortcuts.
|
|
902
|
+
- The `npm --prefix <dir> test` form used in the root scripts is the cross-platform replacement for `cd && npm test` -- works identically on Linux, macOS, and Windows.
|
|
903
|
+
|
|
904
|
+
---
|
|
905
|
+
|
|
824
906
|
## Performance Trade-offs & Topology Scaling
|
|
825
907
|
|
|
826
908
|
<details>
|
|
827
|
-
<summary>Stable vs dynamic topologies; Andrii Volynets' matrix, the 1.1.4 result, the 1.
|
|
909
|
+
<summary>Stable vs dynamic topologies; Andrii Volynets' matrix, the 1.1.4 result, the 1.5.0 ranking, and the roadmap.</summary>
|
|
828
910
|
|
|
829
911
|
`lite-signal` was built with a strict mandate: **absolute zero garbage collection**. By packing the dependency graph into a flat, pre-allocated memory arena, we eliminate the Scavenger GC pauses that plague 120fps Canvas/WebGL loops.
|
|
830
912
|
|
|
@@ -832,7 +914,7 @@ Through **v1.1.2**, that came with a mathematical trade-off: while memory alloca
|
|
|
832
914
|
|
|
833
915
|
**Andrii Volynets** (author of the phenomenal [Alien Signals](https://github.com/stackblitz/alien-signals)) generously ran `lite-signal` through his advanced topology matrix on the **v1.1.2** engine. Those numbers -- the *pre-rewrite baseline* -- are below, followed by the 1.1.4 result.
|
|
834
916
|
|
|
835
|
-
**1.
|
|
917
|
+
**1.5.0-beta on the official [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (15 libraries, 47 tests):** `lite-signal` holds **4th overall by geomean (79.3ms)**, behind only alien-signals (45.2, the field leader at 0.57x), reflex (48.9), and @reactively (59.9), and **ahead of 5th-place Preact Signals (99.8, ~21%)** -- the Preact gap widened this sweep after Preact's own regression on the newer 1.14.2. It finishes **top-3 on 25 of 47 tests** (up from 23 on 1.4.0). Outright-fastest-of-15 wins fluctuate at the top of a very tight leaderboard where alien-signals, reflex, and lite trade sub-percent margins; on this sweep lite is #1 on `createComputations4to1` (7.08ms vs alien's 7.10ms) and on `1000x5 - 25 sources (wide dense)` (the "large web app / wide dense" pattern). Raw log with all 15 x 47 rows: [`bench/AndriiVolynetsReactiveBench.log`](./bench/AndriiVolynetsReactiveBench.log). The stable metric across every published sweep is the geomean rank at 4th of 15 -- and lite remains the only object-pooled, zero-GC engine in the field.
|
|
836
918
|
|
|
837
919
|
#### 1. Stable Topologies (Fan-in / Fan-out / Broadcast)
|
|
838
920
|
In stable environments (game engines, particle systems, visualizers), `lite-signal` is blisteringly fast and maintains a near-zero allocation profile, keeping frame times perfectly flat -- unchanged through 1.1.4.
|
|
@@ -845,34 +927,37 @@ In stable environments (game engines, particle systems, visualizers), `lite-sign
|
|
|
845
927
|
| **1000x5 (25 sources, wide/dense)** | 304ms | 303ms | 1746ms |
|
|
846
928
|
| **64x6 (selective dynamic DAG)** | 181ms | 196ms | 559ms |
|
|
847
929
|
|
|
848
|
-
*1.
|
|
849
|
-
| Scenario | alien-signals | lite-signal (1.
|
|
930
|
+
*1.5.0-beta (default eager) on the local harness (slow 2016 MacBook, one engine per cold process -- compare within-column, lite vs alien; the approximating scenarios from `bench/benchmark.mjs`):*
|
|
931
|
+
| Scenario | alien-signals | lite-signal (1.5.0-beta) | result |
|
|
850
932
|
| :--- | :--- | :--- | :--- |
|
|
851
|
-
| **SELECTIVE DAG** (sqrt-layered, set churn) |
|
|
852
|
-
| **DYNAMIC DAG** (sqrt-layered, FAN=6) |
|
|
853
|
-
| **SMALL SELECTIVE** (~ 64x6) |
|
|
854
|
-
| **LARGE WEB APP** (~ 1000x12) |
|
|
855
|
-
| **WIDE DENSE** (~ 1000x5) |
|
|
856
|
-
|
|
857
|
-
> **Honest note (1.
|
|
858
|
-
> wins are on the **allocation-heavy** dynamic shapes (SELECTIVE DAG +48%, DYNAMIC
|
|
859
|
-
> +
|
|
860
|
-
> allocates near-nothing.
|
|
861
|
-
>
|
|
862
|
-
>
|
|
863
|
-
>
|
|
864
|
-
>
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
933
|
+
| **SELECTIVE DAG** (sqrt-layered, set churn) | 9166ms | 4757ms | **lite +48%** |
|
|
934
|
+
| **DYNAMIC DAG** (sqrt-layered, FAN=6) | 17375ms | 9630ms | **lite +45%** |
|
|
935
|
+
| **SMALL SELECTIVE** (~ 64x6) | 2745ms | 1940ms | **lite +29%** |
|
|
936
|
+
| **LARGE WEB APP** (~ 1000x12) | 2845ms | 2800ms | **lite +2%** (flipped from -3% on 1.4.0) |
|
|
937
|
+
| **WIDE DENSE** (~ 1000x5) | 2719ms | 2870ms | alien +6% |
|
|
938
|
+
|
|
939
|
+
> **Honest note (1.5.0-beta isolated run):** measured one-engine-per-process, lite-signal's
|
|
940
|
+
> big wins are still on the **allocation-heavy** dynamic shapes (SELECTIVE DAG +48%, DYNAMIC
|
|
941
|
+
> DAG +45%, SMALL SELECTIVE +29%) -- exactly where alien churns the nursery and lite's pool
|
|
942
|
+
> allocates near-nothing. **LARGE WEB APP flipped into a small lite win this sweep** (+2%,
|
|
943
|
+
> from -3% on 1.4.0), attributable to the alien-signals 3.1.2 -> 3.2.1 bump between sweeps;
|
|
944
|
+
> on a ~2800ms base the sign of that parity result depends on which third-party version is
|
|
945
|
+
> in the other column. 1.5.0's hot paths are byte-identical to 1.4.0 (1.5.0 adds the
|
|
946
|
+
> `signalBox` / `computedBox` non-callable handle plus `createRoot`, none of which move
|
|
947
|
+
> steady-state throughput), so these match the 1.4.0 isolated numbers within noise -- not
|
|
948
|
+
> engine changes. lite remains the only zero-alloc library on every stable scenario
|
|
949
|
+
> (see [`results.txt`](bench/results.txt)).
|
|
950
|
+
|
|
951
|
+
The cross-framework reactivity suite agrees independently, re-run on **1.5.0-beta** (default eager, median-of-10, isolated): lite-signal is the **fastest of five frameworks on all five `dyn` rows** -- `dyn: large web app` **539ms** (+9% vs alien-signals' 593ms) and `dyn: wide dense` **874ms** (+6% vs 932ms), plus simple component (+19%), dynamic component (+16%), and deep (+12%) -- with preact 6-19x slower and vue 15-32x slower on the app-shaped graphs (see [`resultsReactive.txt`](bench/resultsReactive.txt); the 10 raw runs are checked into [`bench/bench-runs-reactive/`](./bench/bench-runs-reactive/)). **Lite now leads alien on all 7 `S: updateComputations` micro-rows** as well this sweep (was 4/7 on 1.4.0) -- +3% / +6% / +3% / +12% / +3% / +2% / +8% across the family, with the exact per-row numbers in `resultsReactive.txt`. The retracking is verified correct by `retracking.difftest.mjs` -- 20,000 direct + 10,000 batched writes, 0 disagreements against the **published 1.1.5** reference (re-pinned for v1.2).
|
|
952
|
+
|
|
953
|
+
**The Takeaway:** as of 1.1.4 you no longer have to choose, and 1.5.0-beta holds the line -- the engine still ranks **4th of 15** on the official js-reactivity-benchmark (the only zero-GC library in the field). `lite-signal` keeps the zero-GC, flat-arena profile for 120fps Canvas/WebGL **and** wins decisively on the high-churn dynamic and fan-in topologies that dominate live UI -- the shapes where zero allocation pays off most. LARGE WEB APP flipped into a small lite win this sweep after the alien-signals 3.2.1 bump; it runs at parity with alien on the other cheap stable shapes. The one shape where alien's flatter representation still leads is the 256-deep computed pipeline (DEEP CHAIN, -14% on the 1.5.0-beta isolated run -- the gap narrowed from -29% on 1.4.0, again because alien 3.2.1 got slower on that specific shape, not because lite improved).
|
|
869
954
|
|
|
870
955
|
### Roadmap
|
|
871
956
|
- **1.1.5** -- additions in service of `lite-devtools` (node identity/traversability on the introspection walkers, for full auto-discovered graph rendering). *Shipped.*
|
|
872
957
|
- **1.2.0** -- the **ownership hybrid**: an owner tree so nested effects/computeds auto-dispose with their parent (closes conformance #209 / #210, matching Solid's `createRoot` ergonomics). Plus three additive features built on the same internal split: pre-batch revert (`batch(() => { a.set(99); a.set(10); })` doesn't re-fire), multi-throw `AggregateError`, and scheduler-thunk caching with an ABA gen guard. *Shipped.*
|
|
873
958
|
- **1.3.0** -- the **pool minor**: node and link pools become growable and incrementally populated. New `prealloc` config (`"eager"` default | `"lazy"`) chooses up-front vs on-demand construction; `onCapacityExceeded: "grow"` extends pools via chunked refill (runs of up to 1024 links / 256 nodes, ledger doubles) bounded by the 16x link ceiling; `maxFlushPasses` is now a public config. Internally the propagation mark phase moved to an intrusive linked-list stack (a `nextMark` field) -- the only node-shape change. The hot paths and public callable API are byte-identical to 1.2.2; steady-state zero-GC is unchanged. *Shipped.*
|
|
874
|
-
- **1.4.0** -- the **observability minor**: `stats()` gains three cumulative lifecycle counters (`totalAllocations`, `totalDisposals`, `poolGrowths`), the surface reserved for it in the 1.2.x/1.3.0 notes. Monotonic over the registry's life, reset by `destroy()`, bumped on the existing acquire/dispose/grow edges -- no hot-path change, no public callable API change. This is what lite-devtools / lite-studio read to chart allocation rate, pool-reuse ratio, and graph churn. Drop-in over 1.3.0. *Shipped.*
|
|
875
|
-
- **1.5.0** -- the **API-surface minor**: two non-callable, allocation-light primitives `signalBox` / `computedBox` land alongside the callable `signal` / `computed` (same `ReactiveNode`, full interop, ~1.7x cheaper construction), and **`createRoot`** lands as the ownership escape hatch the owner tree was designed for (detached scope for lazily spawning long-lived nodes from inside a consumer effect -- the pattern `lite-query` needs). The callable API, hot paths, and `stats()` shape are unchanged; the `24-signalbox` suite (staged since 1.3.0) now runs and passes. *Shipped (
|
|
959
|
+
- **1.4.0** -- the **observability minor**: `stats()` gains three cumulative lifecycle counters (`totalAllocations`, `totalDisposals`, `poolGrowths`), the surface reserved for it in the 1.2.x/1.3.0 notes. Monotonic over the registry's life, reset by `destroy()`, bumped on the existing acquire/dispose/grow edges -- no hot-path change, no public callable API change. This is what lite-devtools / lite-studio read to chart allocation rate, pool-reuse ratio, and graph churn. Also adds the `harness/VersionMatrix/` regression gate (cold-process, same-host, two baselines) as a `prepublish` step, so a release that regresses `frame.avg` on the four reference workloads (reactive-graph-mix, deep-chain, broadcast-fanout, dynamic-dep-churn) fails the publish. Drop-in over 1.3.0. *Shipped.*
|
|
960
|
+
- **1.5.0** -- the **API-surface minor**: two non-callable, allocation-light primitives `signalBox` / `computedBox` land alongside the callable `signal` / `computed` (same `ReactiveNode`, full interop, ~1.7x cheaper construction), and **`createRoot`** lands as the ownership escape hatch the owner tree was designed for (detached scope for lazily spawning long-lived nodes from inside a consumer effect -- the pattern `lite-query` needs). The callable API, hot paths, and `stats()` shape are unchanged; the `24-signalbox` suite (staged since 1.3.0) now runs and passes. VersionMatrix gains an **identical-code guard** (SHA-256 of the engine source per baseline): a re-versioned publish with byte-identical `Signal.js` is marked `SKIP` structurally rather than flagged by noisy median variance. *Shipped (beta).*
|
|
876
961
|
- **Next** -- `runWithOwner` (the re-attach companion to `createRoot`); the pull-mode recursion depth limit (~5,000 chained computeds) remains the main outstanding architectural item.
|
|
877
962
|
|
|
878
963
|
> Note: the retracking rewrite that closes the dynamic-topology gap shipped in **1.1.4**, not a future release. The earlier roadmap that listed it under "v1.2" is superseded.
|
package/llms.txt
CHANGED
|
@@ -52,7 +52,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
52
52
|
|
|
53
53
|
## Version notes
|
|
54
54
|
|
|
55
|
-
- **1.5.0-
|
|
55
|
+
- **1.5.0-beta** (current): the **API-surface minor**. Two non-callable,
|
|
56
56
|
allocation-light primitives -- `signalBox(initial, opts?)` returning
|
|
57
57
|
`{ get, set, peek, update, subscribe }` and `computedBox(fn, opts?)` returning
|
|
58
58
|
`{ get, peek, subscribe }` -- land alongside the callable `signal` / `computed`,
|
|
@@ -84,6 +84,53 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
84
84
|
tests in `test/27-create-root_test.mjs`). **Coverage:** `Signal.js`
|
|
85
85
|
100% statements / 97.35% branches / 100% functions / 100% lines; `Watch.js` 100%.
|
|
86
86
|
Drop-in over 1.4.0.
|
|
87
|
+
**VersionMatrix (identical-code guard, new in 1.5.0-beta):** the
|
|
88
|
+
`harness/VersionMatrix/` regression gate now records the sha256 of the engine
|
|
89
|
+
source at every capture (`baselines/<label>/engine.sha256`). If the candidate's
|
|
90
|
+
hash matches a baseline's, that axis runs the *same bytes* and the gate marks
|
|
91
|
+
it `SKIP` rather than let variance flag a phantom regression. Genuine code
|
|
92
|
+
changes produce a different hash and are gated normally. Everything else about
|
|
93
|
+
the harness -- cold-process-per-version, LCG-deterministic input, two baselines
|
|
94
|
+
(floor `1.3.0` + rolling `1.5.0-alpha.1`), calibrated tolerances (`frame.avg`
|
|
95
|
+
5% rolling / 10% floor, `frame.p99` and `phase.write.p99` 18% / 30%), four
|
|
96
|
+
workloads mapping to public bench claims -- carries forward from 1.4.0. Wired
|
|
97
|
+
as `prepublishOnly`.
|
|
98
|
+
**Bench position** (third-party
|
|
99
|
+
[js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark),
|
|
100
|
+
15 frameworks, 47 tests; fresh 1.5.0-beta run, raw log
|
|
101
|
+
`bench/AndriiVolynetsReactiveBench.log`): #4 by geomean (79.3) at 1.75x behind
|
|
102
|
+
alien-signals (1.00x, 45.2), reflex (1.08x, 48.9), @reactively (1.33x, 59.9);
|
|
103
|
+
ahead of 5th-place Preact Signals (99.8, lite ~21% ahead -- the gap widened
|
|
104
|
+
after Preact's own regression on the newer 1.14.2 in this sweep). The only
|
|
105
|
+
object-pooled zero-GC engine in the field. Ahead of @vue/reactivity (1.5x),
|
|
106
|
+
Signia (1.7x), MobX (2.2x), @solidjs/signals (3.2x), SolidJS (4.6x). Top-3 on
|
|
107
|
+
25/47 tests (up from 23 on 1.4.0). Outright winners this sweep (rank 1 of all
|
|
108
|
+
15) on TWO shapes: `createComputations4to1` (a computed-creation micro; lite
|
|
109
|
+
edges alien 7.08ms vs 7.10ms) and `1000x5 - 25 sources (wide dense)` (the
|
|
110
|
+
"large web app / wide dense" pattern from the propagation bench). Rank 2 on
|
|
111
|
+
another nine shapes (broadPropagation, diamond, repeatedObservers, unstable
|
|
112
|
+
propagation, `manySourcesIntoOneComputedEffect`, `manySourcesIntoOneDirectEffect`,
|
|
113
|
+
`molBench`, `32x8 - 4 sources - pull`, and `10x5 - 2 sources - read 20%` simple
|
|
114
|
+
component). The outright-win count fluctuates
|
|
115
|
+
at the top of a very tight leaderboard where alien-signals, reflex, and lite
|
|
116
|
+
trade sub-percent margins per shape (1.4.0 sweep had lite outright on 5
|
|
117
|
+
shapes; this sweep 2); the geomean rank at #4 has held across every published
|
|
118
|
+
sweep and is the honest stable metric. (The suite measures reactivity
|
|
119
|
+
libraries -- Vue reactivity core, MobX, Solid, Preact Signals -- not full UI
|
|
120
|
+
frameworks like React/Angular.)
|
|
121
|
+
In the community reactive suite (median-of-10, raw runs in
|
|
122
|
+
`bench/bench-runs-reactive/run_1.txt` ... `run_10.txt`), fastest of 5
|
|
123
|
+
frameworks on the entire `dyn:*` family (the realistic large-DOM-framework
|
|
124
|
+
shapes): dyn: simple 433.17ms (+19% vs alien), dynamic 311.74ms (+16%), large
|
|
125
|
+
web app 539.05ms (+9%), wide dense 874.01ms (+6%), deep 333.06ms (+12%).
|
|
126
|
+
**Lite now leads alien on ALL 7 `S: updateComputations` rows this sweep**
|
|
127
|
+
(+3%/+6%/+3%/+12%/+3%/+2%/+8%; was 4/7 on 1.4.0). Behind on the
|
|
128
|
+
construction-cost path (`S: createComputations*`, `cellx`, `createDataSignals`).
|
|
129
|
+
Third-party engine versions bumped since the 1.4.0 sweep (alien-signals
|
|
130
|
+
3.1.2 -> 3.2.1, @preact/signals-core 1.14.1 -> 1.14.2, @vue/reactivity
|
|
131
|
+
3.5.13 -> 3.5.35, solid-js 1.9.12 -> 1.9.13); any within-lib delta reflects
|
|
132
|
+
those bumps + host noise, not lite-signal changes (1.4.0 -> 1.5.0 hot paths
|
|
133
|
+
are byte-identical).
|
|
87
134
|
|
|
88
135
|
- **1.4.0** (drop-in over 1.3.0): the **observability minor**. `stats()` gains three
|
|
89
136
|
cumulative lifecycle counters -- `totalAllocations`, `totalDisposals`,
|
|
@@ -470,42 +517,45 @@ None of these touch the reactive engine -- no `FLAG_WATCHER` on `ReactiveNode`,
|
|
|
470
517
|
|
|
471
518
|
The deliberate engineering for `watch`'s "0 per fire" is the hoisted `untrackedFire` closure with `currentNewValue` shared mutable state -- see source comment in `watch.js`. Inline arrow function inside the effect body would allocate per fire and break the zero-GC contract.
|
|
472
519
|
|
|
473
|
-
## Benchmark snapshot (Node 22, 2016-era Intel MacBook Pro, default eager, median across reps -- @1.
|
|
520
|
+
## Benchmark snapshot (Node 22, 2016-era Intel MacBook Pro, default eager, median across reps -- @1.5.0-beta.0)
|
|
474
521
|
|
|
475
522
|
`benchmark.mjs` head-to-head vs alien-signals on app-shaped scenarios (time = median
|
|
476
523
|
execution; heap = average transient delta-heap per rep; lite-signal numbers are
|
|
477
|
-
@1.
|
|
524
|
+
@1.5.0-beta.0, hot paths byte-identical to 1.4.0 -- 1.5.0 adds only the
|
|
525
|
+
`signalBox` / `computedBox` non-callable handle and `createRoot`, neither on the
|
|
526
|
+
steady-state read/write path; third-party engines bumped since 1.4.0 sweep --
|
|
527
|
+
alien-signals 3.1.2 -> 3.2.1 in particular):
|
|
478
528
|
|
|
479
529
|
| Scenario | lite vs alien (time) | transient heap (lite / alien) |
|
|
480
530
|
| -------------------------------- | -------------------- | ----------------------------- |
|
|
481
|
-
| SELECTIVE DAG (set churn) | **+48% faster** | 1.
|
|
482
|
-
| DYNAMIC DAG (FAN=6, read flips) | **+
|
|
483
|
-
| MUX (256 sigs -> sum -> effect) | **+
|
|
484
|
-
| SMALL SELECTIVE (~64x6) | **+29% faster** | 0.3 KB /
|
|
485
|
-
|
|
|
486
|
-
|
|
|
487
|
-
|
|
|
488
|
-
| BROADCAST (1 -> 1000 effects) | -
|
|
489
|
-
| DEEP CHAIN (256-deep -> effect) | -
|
|
531
|
+
| SELECTIVE DAG (set churn) | **+48% faster** | 1.7 MB / 31 MB |
|
|
532
|
+
| DYNAMIC DAG (FAN=6, read flips) | **+45% faster** | 4.3 MB / 26 MB |
|
|
533
|
+
| MUX (256 sigs -> sum -> effect) | **+33% faster** | 38 KB / 3.9 MB |
|
|
534
|
+
| SMALL SELECTIVE (~64x6) | **+29% faster** | 0.3 KB / 25.9 MB |
|
|
535
|
+
| LARGE WEB APP (~1000x12) | **+2% faster** | 0.3 KB / 41 KB |
|
|
536
|
+
| WIDE DENSE (~1000x5) | -6% (parity) | 0.3 KB / 11.6 MB |
|
|
537
|
+
| KAIROS (1 -> 1000 computeds) | -7% (parity) | 178 KB / 1.0 MB |
|
|
538
|
+
| BROADCAST (1 -> 1000 effects) | -12% | 72 KB / 21 KB |
|
|
539
|
+
| DEEP CHAIN (256-deep -> effect) | -14% | 18 KB / 1.8 MB |
|
|
490
540
|
|
|
491
541
|
lite-signal's time wins are the allocation-heavy dynamic shapes (object pool allocates
|
|
492
542
|
near-nothing; alien churns the nursery), plus MUX fan-in aggregation -- the patterns
|
|
493
|
-
that dominate live UI under input churn.
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
The cross-framework reactivity suite (5 frameworks) re-run on 1.
|
|
543
|
+
that dominate live UI under input churn. LARGE WEB APP flipped into a small lite win
|
|
544
|
+
this sweep (+2%, was -3% on 1.4.0) after the alien 3.1.2 -> 3.2.1 bump. Parity on
|
|
545
|
+
WIDE DENSE / KAIROS (within run-to-run noise on this old host). Two losses: BROADCAST
|
|
546
|
+
(pure fan-out, no retracking for the pool to amortize) and DEEP CHAIN (alien's flatter
|
|
547
|
+
representation still wins on long chains, though the gap narrowed from -29% on 1.4.0
|
|
548
|
+
to -14% here -- alien 3.2.1 got slower on 256-deep, lite's DEEP CHAIN barely moved).
|
|
549
|
+
On allocation, lite wins 8/9 scenarios and is alone in the zero-alloc band (~0.3 KB
|
|
550
|
+
transient on the stable app shapes).
|
|
551
|
+
|
|
552
|
+
The cross-framework reactivity suite (5 frameworks) re-run on 1.5.0-beta (default eager,
|
|
503
553
|
median-of-10): lite-signal is fastest on all five `dyn:*` rows -- `dyn: large web app`
|
|
504
|
-
|
|
505
|
-
simple component (+
|
|
506
|
-
slower and vue 15-32x slower on the app-shaped graphs. On the
|
|
507
|
-
|
|
508
|
-
|
|
554
|
+
539ms (+9% vs alien-signals' 593ms), `dyn: wide dense` 874ms (+6% vs 932ms), plus
|
|
555
|
+
simple component (+19%), dynamic component (+16%), deep (+12%) -- with preact 6-19x
|
|
556
|
+
slower and vue 15-32x slower on the app-shaped graphs. On the `S: updateComputations`
|
|
557
|
+
micro-rows **lite now leads alien on ALL 7 rows this sweep** (+3% / +6% / +3% / +12% /
|
|
558
|
+
+3% / +2% / +8%; was 4/7 on 1.4.0). Retracking verified correct by
|
|
509
559
|
`retracking.difftest.mjs` (20,000 direct + 10,000 batched writes, 0 disagreements vs
|
|
510
560
|
published 1.1.5). `prealloc: "lazy"` trades a little first-construction allocation on the
|
|
511
561
|
dynamic shapes for a smaller resident heap and faster cold start; steady state identical.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.5.0-
|
|
3
|
+
"version": "1.5.0-beta.1",
|
|
4
4
|
"description": "Zero-GC reactive graph. Monomorphic object pool, versioned push-pull propagation, 32-bit modular versioning. Built for hot paths and long-running processes.",
|
|
5
5
|
"author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"types": "./Signal.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./Signal.d.ts",
|
|
13
14
|
"node": "./Signal.js",
|
|
14
15
|
"import": "./Signal.js",
|
|
15
|
-
"types": "./Signal.d.ts",
|
|
16
16
|
"default": "./Signal.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
@@ -26,12 +26,18 @@
|
|
|
26
26
|
"CHANGELOG.md"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"test": "node --test --test-reporter=spec",
|
|
30
|
-
"test:gc": "node --expose-gc --test --test-reporter=spec",
|
|
31
|
-
"test:coverage": "c8 node --test --test-reporter=spec",
|
|
29
|
+
"test": "node --test --test-reporter=spec 'test/*.test.mjs'",
|
|
30
|
+
"test:gc": "node --expose-gc --test --test-reporter=spec 'test/*.test.mjs'",
|
|
31
|
+
"test:coverage": "c8 node --test --test-reporter=spec 'test/*.test.mjs'",
|
|
32
|
+
"test:hardening": "npm --prefix test/ProfilerTests test",
|
|
33
|
+
"test:hardening:gc": "npm --prefix test/ProfilerTests run test:gc",
|
|
34
|
+
"test:harness": "npm --prefix harness/ProfilerTools test",
|
|
35
|
+
"test:all": "npm test && npm run test:hardening && npm run test:harness",
|
|
32
36
|
"bench": "node --expose-gc bench/benchmark.mjs",
|
|
33
37
|
"bench-reactive": "node --expose-gc bench/benchmarkReactive.mjs",
|
|
34
|
-
"verify": "npm test && npm run bench"
|
|
38
|
+
"verify": "npm test && npm run bench",
|
|
39
|
+
"gate": "node harness/VersionMatrix/pre-publish.mjs",
|
|
40
|
+
"prepublishOnly": "node harness/VersionMatrix/pre-publish.mjs"
|
|
35
41
|
},
|
|
36
42
|
"keywords": [
|
|
37
43
|
"signal",
|
|
@@ -69,6 +75,17 @@
|
|
|
69
75
|
"sideEffects": false,
|
|
70
76
|
"devDependencies": {
|
|
71
77
|
"c8": "^11.0.0",
|
|
72
|
-
"@zakkster/lite-devtools": "^1.1.0"
|
|
78
|
+
"@zakkster/lite-devtools": "^1.1.0",
|
|
79
|
+
"@zakkster/lite-signal": "^1.3.0 || >=1.4.0-beta.0 || >=1.6.0-preview.0",
|
|
80
|
+
"@zakkster/lite-profiler": "^1.1.0",
|
|
81
|
+
"@zakkster/lite-profiler-signal": "^1.2.0"
|
|
82
|
+
},
|
|
83
|
+
"overrides": {
|
|
84
|
+
"@zakkster/lite-time": {
|
|
85
|
+
"@zakkster/lite-signal": "$@zakkster/lite-signal"
|
|
86
|
+
},
|
|
87
|
+
"@zakkster/lite-devtools": {
|
|
88
|
+
"@zakkster/lite-signal": "$@zakkster/lite-signal"
|
|
89
|
+
}
|
|
73
90
|
}
|
|
74
91
|
}
|