@zakkster/lite-signal 1.5.0-beta.6 → 1.5.0-beta.7
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 +63 -37
- package/README.md +38 -37
- package/llms.txt +44 -37
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -347,43 +347,69 @@ tolerances (`frame.avg` 5% rolling / 10% floor, `frame.p99` and `phase.write.p99
|
|
|
347
347
|
18% / 30%), four workloads mapping to public bench claims -- carries forward
|
|
348
348
|
from 1.4.0. Details in `harness/VersionMatrix/README.md`.
|
|
349
349
|
|
|
350
|
-
### Verified -- fresh 1.5.0-beta bench sweep
|
|
351
|
-
|
|
352
|
-
Both
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
350
|
+
### Verified -- fresh 1.5.0-beta bench sweep (Apple M4 Pro / Node 26)
|
|
351
|
+
|
|
352
|
+
Both v3 instruments were re-run in full on the 1.5.0-beta engine on **Apple
|
|
353
|
+
M4 Pro darwin/arm64, Node 26.3.1** (a step up from the 1.4.0 sweep's 2016
|
|
354
|
+
Intel MacBook / Node 22 host), with `#STAMP`-verified outputs committed to
|
|
355
|
+
`bench/rb.txt` (microscope aggregate, 4 engines across the six first-party
|
|
356
|
+
shapes) and `bench/r.txt` (mirror sweep, Andrii's canonical adapter verbatim,
|
|
357
|
+
lite vs alien across 47 rows, isolated-per-row, 10 reps). The M4 Pro host has
|
|
358
|
+
a lower run-to-run noise floor than the old Intel host, so the sub-percent
|
|
359
|
+
parity band tightens and the honest wins/losses stand out cleanly.
|
|
360
|
+
|
|
361
|
+
- **Microscope aggregate (rb.txt):** on the six v3 microscope shapes, lite
|
|
362
|
+
wins vs alien on **MUX +34.6%** (fan-in), **SELECTIVE DAG +20.0%**, and
|
|
363
|
+
**DYNAMIC DAG +18.4%** -- the allocation-heavy dynamic shapes stay lite's
|
|
364
|
+
home turf; the wins narrow versus the older Intel sweep (fast machine has
|
|
365
|
+
less GC pause to hide behind, so alien's raw propagation surfaces more) but
|
|
366
|
+
the ordering is intact. **BROADCAST is a true tie** (-1.2%, both under the
|
|
367
|
+
GC delta floor). Alien ahead on **KAIROS -15.7%** (1000 shared-source
|
|
368
|
+
computeds -- alien's flatter representation prices in the walk cheaper on
|
|
369
|
+
M4-class silicon) and **DEEP CHAIN -76.9%** (256-deep chain -- the same
|
|
370
|
+
architectural weak spot the honest framing has always named; recursive
|
|
371
|
+
JS-stack computed resolution loses to alien's flatter chain on hot new
|
|
372
|
+
cores by a wider margin than on old Intel). Speed wins vs alien: **3/6**;
|
|
373
|
+
heap wins: **5/6** with the sixth being a shared-zero on BROADCAST.
|
|
374
|
+
- **Microscope heap (the actual story):** on every shape where GC pressure
|
|
375
|
+
exists at all, lite allocates **one to four orders of magnitude less
|
|
376
|
+
transient heap than alien** -- DEEP CHAIN 0.5 KB vs 1062 KB (>2000x, on
|
|
377
|
+
the shape lite loses on time), MUX 0 KB vs 781 KB, KAIROS 23 KB vs 802 KB
|
|
378
|
+
(34.8x), DYNAMIC DAG 3.1 MB vs 60.7 MB (19.5x), SELECTIVE DAG 7.7 MB vs
|
|
379
|
+
78.0 MB (10.2x). Against preact-signals and solid-signals the heap gap is
|
|
380
|
+
even wider on the fan-in / fan-out family; solid allocates ~17 MB on MUX
|
|
381
|
+
and ~15 MB on SELECTIVE DAG where lite allocates 0 KB and 7.7 MB on the
|
|
382
|
+
same shapes. The differentiated position is ALLOCATION, not raw
|
|
383
|
+
propagation speed -- competitive-to-winning throughput with dramatically
|
|
384
|
+
lower GC pressure, and that is the headline that reproduces across hosts.
|
|
385
|
+
- **Mirror sweep (r.txt):** Andrii's canonical 47-shape suite re-run
|
|
386
|
+
isolated-per-row lite vs alien on M4 Pro reproduces the same honest
|
|
387
|
+
framing: lite runs **parity-to-behind alien on throughput** across the
|
|
388
|
+
suite (wins outright on 4/47 -- `1000x5 - 25 sources (wide dense)` +12%,
|
|
389
|
+
`manySourcesIntoOneComputedEffectWithDirect` +32.5%,
|
|
390
|
+
`manySourcesIntoOneComputedEffect` +31.7%, and `createComputations4to1`
|
|
391
|
+
+19.3%), weak on the deep/layered-burst family. Every row carries a
|
|
392
|
+
`#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` /
|
|
393
|
+
`sinkReads`) match Andrii's published suite exactly (`mirror.mjs
|
|
394
|
+
--self-verify`), so a lite-vs-alien delta here is identical work, not DCE.
|
|
395
|
+
- **Andrii Volynets js-reactivity-benchmark position holds at 4th of 15**
|
|
396
|
+
with geomean **79.3ms** (raw log `bench/AndriiVolynetsReactiveBench.log`,
|
|
397
|
+
Andrii's own host); lite is ahead of 5th-place Preact Signals (99.8) by
|
|
398
|
+
~21%. Top-3 count: **25/47** (up from 23 on 1.4.0);
|
|
399
|
+
outright-fastest-of-15 wins fluctuate at the top of a very tight
|
|
400
|
+
leaderboard where alien-signals / reflex / lite trade sub-percent margins
|
|
401
|
+
per shape (5 on 1.4.0, **2 on 1.5.0-beta** -- `createComputations4to1`
|
|
402
|
+
and `1000x5 - 25 sources (wide dense)`), plus 9 second-place finishes.
|
|
403
|
+
The stable metric across every published sweep is the geomean rank at #4
|
|
404
|
+
of 15.
|
|
405
|
+
- **Third-party version bumps** used in the local head-to-head vs 1.4.0:
|
|
406
|
+
alien-signals 3.1.2 -> 3.2.1, @preact/signals-core 1.14.1 -> 1.14.2,
|
|
407
|
+
@vue/reactivity 3.5.13 -> 3.5.35, solid-js 1.9.12 -> 1.9.13. Any
|
|
408
|
+
within-lib delta between the two sweeps reflects those bumps + the
|
|
409
|
+
Intel -> M4 Pro host change, not lite-signal changes: 1.4.0 -> 1.5.0
|
|
410
|
+
hot-path bytes are byte-identical (1.5.0 adds only the non-callable box
|
|
411
|
+
handle shape, which affects construction cost and handle ergonomics but
|
|
412
|
+
not the pooled-node read/write path).
|
|
387
413
|
|
|
388
414
|
## [1.4.0] -- 2026-06-XX
|
|
389
415
|
|
package/README.md
CHANGED
|
@@ -723,27 +723,24 @@ These are the questions you'd ask in a code review, with the answers:
|
|
|
723
723
|
|
|
724
724
|
## Benchmarks
|
|
725
725
|
|
|
726
|
-
Honest numbers, against the same workload, with anti-DCE sinks and verified effect execution. All measurements: Node
|
|
726
|
+
Honest numbers, against the same workload, with anti-DCE sinks and verified effect execution. All measurements: **Node 26.3.1, Apple M4 Pro (darwin/arm64)**, **one engine per cold process**, median across reps, machine-stamped `#STAMP` (engine + harness sha256, live registry config, host, node) on every output. Newer/faster machines shift all libs up proportionally; the relative ordering between libs is what matters -- and on this newer silicon the run-to-run noise floor is lower, so the sub-percent parity band tightens and the honest wins/losses stand out cleanly. Numbers below are the **fresh 1.5.0-beta bench sweep** on the v3 **microscope** (`benchmark.mjs`, six first-party shapes, default `prealloc: "eager"`) vs alien-signals -- 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 reflects the same engine bytes the 1.4.0 sweep measured; the deltas below are the M4 Pro / Node 26 machine speaking, plus the third-party version bumps since 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). Full outputs: [`bench/rb.txt`](bench/rb.txt) (this microscope aggregate across four engines) and [`bench/r.txt`](bench/r.txt) (the mirror sweep -- Andrii's canonical adapter verbatim, 47 rows, lite vs alien on the same M4 Pro host).
|
|
727
727
|
|
|
728
728
|
| Scenario | What it stresses | lite-signal | alien-signals | lite vs alien | transient heap (lite / alien) |
|
|
729
729
|
| ---------- | -------------------------------- | ----------- | ------------- | ------------- | ----------------------------- |
|
|
730
|
-
| **
|
|
731
|
-
| **
|
|
732
|
-
| **
|
|
733
|
-
| **
|
|
734
|
-
| **
|
|
735
|
-
| **
|
|
736
|
-
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect | 1418 ms | 1327 ms | -7% (parity) | 178 KB / 1.0 MB (5.9x less) |
|
|
737
|
-
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) | 1210 ms | 1084 ms | -12% | 72 KB / 21 KB |
|
|
738
|
-
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 398 ms | **349 ms** | -14% | 18 KB / 1.8 MB (96x less) |
|
|
730
|
+
| **MUX** | 256 signals -> 1 sum -> 1 effect (fan-in) | **22.52 ms** | 34.46 ms | **+34.6% faster** | **0 KB / 781 KB** (100% less) |
|
|
731
|
+
| **SELECTIVE DAG** | sqrt-layered, set churn, 2 read/iter | **1994 ms** | 2493 ms | **+20.0% faster** | **7.7 MB / 78.0 MB** (90.2% less, 10.2x) |
|
|
732
|
+
| **DYNAMIC DAG** | sqrt-layered, FAN=6, read flips each iter | **3601 ms** | 4415 ms | **+18.4% faster** | **3.1 MB / 60.7 MB** (94.9% less, 19.5x) |
|
|
733
|
+
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) | 458.04 ms | 452.78 ms | -1.2% (parity) | ~0 KB / ~0 KB (both fit under GC floor) |
|
|
734
|
+
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect | 517.75 ms | 447.64 ms | -15.7% | **23 KB / 802 KB** (97.1% less, 34.8x) |
|
|
735
|
+
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 170.89 ms | **96.59 ms** | -76.9% | **0.5 KB / 1062 KB** (100% less, >2000x) |
|
|
739
736
|
|
|
740
737
|
*(lower time = faster; transient heap = average delta-heap per rep, lower = less GC pressure)*
|
|
741
738
|
|
|
742
|
-
**Reading the table:** lite-signal's
|
|
739
|
+
**Reading the table:** the M4 Pro sweep clarifies exactly which of lite-signal's wins are real and which were noise on a slower host. The **allocation-heavy dynamic shapes stay lite's home turf**: **MUX +34.6%** (fan-in aggregation), **SELECTIVE DAG +20.0%**, and **DYNAMIC DAG +18.4%** -- the wins narrow versus the older Intel sweep (the fast machine has less GC pause to hide behind, so alien's raw propagation shows up more) but the ordering is intact, and these are the patterns that dominate live UI workloads under input churn: dashboards, scoreboards, HUDs, leaderboards. **BROADCAST is a true tie** on this host (-1.2%, both engines fit under the GC delta floor). The two losses tell a consistent story: **KAIROS -15.7%** (1000 computeds sharing a single source -- alien's flatter representation prices in the walk cheaper than lite's pooled-link graph on M4-class silicon) and **DEEP CHAIN -76.9%** (a 256-deep computed pipeline, the same architectural weak spot the honest framing has always named: recursive JS-stack computed resolution loses to alien's flatter chain on hot new cores by a wider margin than on old Intel). The mirror-sweep companion ([`bench/r.txt`](bench/r.txt)) reproduces the same picture across Andrii's 47 shapes: lite runs **parity-to-behind alien on throughput**, wins outright on 4 of the 47 (`1000x5 - 25 sources (wide dense)` +12%, both `manySourcesIntoOne*ComputedEffect` fan-ins ~+32%, and `createComputations4to1` +19%) -- and this is not the story to tell.
|
|
743
740
|
|
|
744
|
-
On
|
|
741
|
+
**The story is the heap column.** On every microscope shape where GC pressure exists at all, `lite-signal` allocates **one to four orders of magnitude less transient heap than alien-signals**: DEEP CHAIN 0.5 KB vs 1062 KB (>2000x less -- yes, on the shape where lite is behind on time), MUX 0 KB vs 781 KB, KAIROS 23 KB vs 802 KB (34.8x), DYNAMIC DAG 3.1 MB vs 60.7 MB (19.5x), SELECTIVE DAG 7.7 MB vs 78.0 MB (10.2x). On BROADCAST both engines are effectively zero. Against preact-signals and solid-signals the heap gap is even wider on the fan-in / fan-out family -- solid allocates ~17 MB on MUX and ~15 MB on SELECTIVE DAG where lite allocates 0 KB and 7.7 MB respectively (`bench/rb.txt`). **`lite-signal`'s differentiated position is ALLOCATION, not raw propagation speed**: competitive-to-winning throughput with dramatically lower GC pressure, not "fastest dynamic-graph engine". That headline is the one that reproduces across hosts, sweeps, and third-party version bumps -- because the object pool is the mechanism, not a tuning knob.
|
|
745
742
|
|
|
746
|
-
> Note on the +
|
|
743
|
+
> Note on the +23 KB delta-heap that lite-signal shows on KAIROS: 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 shapes the graph is small enough that the same pool floats below the GC baseline.
|
|
747
744
|
|
|
748
745
|
The benchmark harness is in [`bench/benchmark.mjs`](./bench/benchmark.mjs); a full methodology write-up -- including the anti-DCE design, workload diagrams, variance discipline, reproducibility recipe, and a self-validation procedure for the harness itself -- lives in [`bench/README.md`](./bench/README.md). It:
|
|
749
746
|
|
|
@@ -817,7 +814,7 @@ npm run test:gc
|
|
|
817
814
|
|
|
818
815
|
### Tier 3 -- Performance (comparative benchmark)
|
|
819
816
|
|
|
820
|
-
`npm run bench` runs the **microscope** -- lite's recommended eager config on six first-party shapes
|
|
817
|
+
`npm run bench` runs the **microscope** -- lite's recommended eager config on six first-party shapes; the aggregate output is [`bench/rb.txt`](bench/rb.txt) (four engines: lite, alien, preact, solid). Cross-framework standing comes from the **mirror** (`node --expose-gc bench/mirror.mjs --self-verify` then `bench/sweep.mjs`), which runs Andrii's canonical adapter verbatim so rows diff 1:1 against his log; the aggregate output is [`bench/r.txt`](bench/r.txt) (lite vs alien, all 47 shapes). Every output carries a machine-generated `#STAMP` (engine + harness sha256, the live registry config, host, node), so a header can never disagree with the code that ran. The pre-v3 five-framework reactivity suite is retained one release as `bench-reactive-legacy` (**deprecated -- removed after 1.5.1**). Full methodology: [`bench/README.md`](./bench/README.md).
|
|
821
818
|
|
|
822
819
|
```bash
|
|
823
820
|
npm run bench
|
|
@@ -971,30 +968,34 @@ In stable environments (game engines, particle systems, visualizers), `lite-sign
|
|
|
971
968
|
| **1000x5 (25 sources, wide/dense)** | 304ms | 303ms | 1746ms |
|
|
972
969
|
| **64x6 (selective dynamic DAG)** | 181ms | 196ms | 559ms |
|
|
973
970
|
|
|
974
|
-
*1.5.0-beta (default eager) on the
|
|
971
|
+
*1.5.0-beta (default eager) on the v3 microscope (`bench/rb.txt`, Apple M4 Pro darwin/arm64, Node 26.3.1, one engine per cold process -- compare within-column, lite vs alien):*
|
|
975
972
|
| Scenario | alien-signals | lite-signal (1.5.0-beta) | result |
|
|
976
973
|
| :--- | :--- | :--- | :--- |
|
|
977
|
-
| **
|
|
978
|
-
| **
|
|
979
|
-
| **
|
|
980
|
-
| **
|
|
981
|
-
| **
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
>
|
|
985
|
-
>
|
|
986
|
-
>
|
|
987
|
-
>
|
|
988
|
-
>
|
|
989
|
-
>
|
|
990
|
-
>
|
|
991
|
-
>
|
|
992
|
-
>
|
|
993
|
-
> (
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
974
|
+
| **MUX** (256 sigs -> sum -> effect) | 34.46 ms | 22.52 ms | **lite +34.6%** |
|
|
975
|
+
| **SELECTIVE DAG** (sqrt-layered, set churn) | 2493 ms | 1994 ms | **lite +20.0%** |
|
|
976
|
+
| **DYNAMIC DAG** (sqrt-layered, FAN=6) | 4415 ms | 3601 ms | **lite +18.4%** |
|
|
977
|
+
| **BROADCAST** (1 -> 1000 effects) | 452.78 ms | 458.04 ms | tie (-1.2%, both under GC floor) |
|
|
978
|
+
| **KAIROS** (1 -> 1000 computeds) | 447.64 ms | 517.75 ms | alien +15.7% |
|
|
979
|
+
| **DEEP CHAIN** (256-deep -> effect) | 96.59 ms | 170.89 ms | alien +76.9% |
|
|
980
|
+
|
|
981
|
+
> **Honest note (1.5.0-beta on M4 Pro):** measured one-engine-per-process, lite-signal's
|
|
982
|
+
> wins cluster on the **allocation-heavy** dynamic shapes (MUX +34.6%, SELECTIVE DAG
|
|
983
|
+
> +20.0%, DYNAMIC DAG +18.4%) -- exactly where alien churns the nursery and lite's pool
|
|
984
|
+
> allocates near-nothing. The wins narrow versus the older Intel MacBook sweep (fast
|
|
985
|
+
> machine has less GC pause to hide behind, so alien's raw propagation surfaces more)
|
|
986
|
+
> but the ordering is intact. BROADCAST is a true tie on this host. Alien ahead on
|
|
987
|
+
> KAIROS -15.7% (1000 shared-source computeds -- alien's flatter representation prices
|
|
988
|
+
> in the walk cheaper on M4-class silicon) and DEEP CHAIN -76.9% (the same architectural
|
|
989
|
+
> weak spot the honest framing has always named). 1.5.0's hot paths are byte-identical
|
|
990
|
+
> to 1.4.0 (1.5.0 adds the `signalBox` / `computedBox` non-callable handle plus
|
|
991
|
+
> `createRoot`, none of which move steady-state throughput), so the deltas here are the
|
|
992
|
+
> M4 Pro / Node 26 host speaking, plus the third-party version bumps -- not engine
|
|
993
|
+
> changes. lite remains one to four orders of magnitude below alien on transient heap
|
|
994
|
+
> on every shape where GC pressure exists at all (see [`bench/rb.txt`](bench/rb.txt)).
|
|
995
|
+
|
|
996
|
+
The mirror sweep ([`bench/r.txt`](bench/r.txt), Andrii's canonical adapter verbatim, isolated-per-row, 10 reps, lite vs alien across all 47 shapes on the same M4 Pro host) reproduces the same picture: lite runs **parity-to-behind alien on throughput**, wins outright on 4/47 (`1000x5 - 25 sources (wide dense)` +12%, both `manySourcesIntoOne*ComputedEffect` fan-ins ~+32%, and `createComputations4to1` +19%), weak on the deep/layered-burst family. Every row carries a `#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` / `sinkReads`) match Andrii's published suite exactly, so a lite-vs-alien delta here is identical work, not DCE. 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).
|
|
997
|
+
|
|
998
|
+
**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. On the M4 Pro sweep the win margins narrow on the dynamic shapes (SELECTIVE DAG +20%, DYNAMIC DAG +18%, MUX +34.6%) because the fast machine has less GC pause to hide behind; the ordering is intact and the heap column is the story that reproduces everywhere. The one shape where alien's flatter representation still leads decisively is the 256-deep computed pipeline (DEEP CHAIN -76.9% on the M4 Pro isolated run -- the gap widened from -14% on the older Intel sweep because recursive JS-stack computed resolution loses to alien's flatter chain on hot new cores by a wider margin than on old Intel; lite's allocation on DEEP CHAIN is 0.5 KB vs alien's 1062 KB, >2000x less transient heap on the same shape).
|
|
998
999
|
|
|
999
1000
|
### Roadmap
|
|
1000
1001
|
- **1.1.5** -- additions in service of `lite-devtools` (node identity/traversability on the introspection walkers, for full auto-discovered graph rendering). *Shipped.*
|
|
@@ -1252,7 +1253,7 @@ Yes, if your computeFn reads its deps in the same order each invocation. The `cu
|
|
|
1252
1253
|
```bash
|
|
1253
1254
|
npm test # behavior suite, ~1.3s
|
|
1254
1255
|
npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
|
|
1255
|
-
npm run bench #
|
|
1256
|
+
npm run bench # microscope + mirror comparative benches (rb.txt / r.txt), ~5min
|
|
1256
1257
|
node --expose-gc bench/benchmarkReactive.mjs # DEPRECATED pre-v3 reactivity suite (removed after 1.5.1)
|
|
1257
1258
|
npm run harness:field # verify + cold-child A/B bench (fieldkit)
|
|
1258
1259
|
npm run harness:all # field + dispose + churn probes, in sequence
|
package/llms.txt
CHANGED
|
@@ -578,51 +578,58 @@ None of these touch the reactive engine -- no `FLAG_WATCHER` on `ReactiveNode`,
|
|
|
578
578
|
|
|
579
579
|
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.
|
|
580
580
|
|
|
581
|
-
## Benchmark snapshot (Node
|
|
581
|
+
## Benchmark snapshot (Node 26.3.1, Apple M4 Pro darwin/arm64, default eager, median across reps -- @1.5.0-beta.0)
|
|
582
582
|
|
|
583
|
-
`benchmark.mjs
|
|
584
|
-
execution; heap = average transient delta-heap per rep; lite-signal
|
|
585
|
-
@1.5.0-beta.0, hot paths byte-identical to 1.4.0 -- 1.5.0 adds only the
|
|
583
|
+
v3 microscope (`benchmark.mjs`, six first-party shapes) head-to-head vs alien-signals
|
|
584
|
+
(time = median execution; heap = average transient delta-heap per rep; lite-signal
|
|
585
|
+
numbers are @1.5.0-beta.0, hot paths byte-identical to 1.4.0 -- 1.5.0 adds only the
|
|
586
586
|
`signalBox` / `computedBox` non-callable handle and `createRoot`, neither on the
|
|
587
587
|
steady-state read/write path; third-party engines bumped since 1.4.0 sweep --
|
|
588
|
-
alien-signals 3.1.2 -> 3.2.1 in particular
|
|
588
|
+
alien-signals 3.1.2 -> 3.2.1 in particular; host changed from 2016 Intel MacBook /
|
|
589
|
+
Node 22 to Apple M4 Pro / Node 26, which lowers the run-to-run noise floor):
|
|
589
590
|
|
|
590
591
|
| Scenario | lite vs alien (time) | transient heap (lite / alien) |
|
|
591
592
|
| -------------------------------- | -------------------- | ----------------------------- |
|
|
592
|
-
|
|
|
593
|
-
|
|
|
594
|
-
|
|
|
595
|
-
|
|
|
596
|
-
|
|
|
597
|
-
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
593
|
+
| MUX (256 sigs -> sum -> effect) | **+34.6% faster** | 0 KB / 781 KB (100% less) |
|
|
594
|
+
| SELECTIVE DAG (set churn) | **+20.0% faster** | 7.7 MB / 78.0 MB (10.2x) |
|
|
595
|
+
| DYNAMIC DAG (FAN=6, read flips) | **+18.4% faster** | 3.1 MB / 60.7 MB (19.5x) |
|
|
596
|
+
| BROADCAST (1 -> 1000 effects) | -1.2% (parity) | ~0 KB / ~0 KB (both zero) |
|
|
597
|
+
| KAIROS (1 -> 1000 computeds) | -15.7% | 23 KB / 802 KB (34.8x) |
|
|
598
|
+
| DEEP CHAIN (256-deep -> effect) | -76.9% | 0.5 KB / 1062 KB (>2000x) |
|
|
599
|
+
|
|
600
|
+
lite-signal's time wins on the M4 Pro sweep cluster on the allocation-heavy dynamic
|
|
601
|
+
shapes (object pool allocates near-nothing; alien churns the nursery), plus MUX fan-in
|
|
602
|
+
aggregation -- the patterns that dominate live UI under input churn. The wins narrow
|
|
603
|
+
versus the older Intel sweep (fast machine has less GC pause to hide behind, so
|
|
604
|
+
alien's raw propagation surfaces more) but the ordering is intact. BROADCAST is a true
|
|
605
|
+
tie on this host (both under the GC delta floor). Two losses: KAIROS -15.7%
|
|
606
|
+
(1000 shared-source computeds -- alien's flatter representation prices in the walk
|
|
607
|
+
cheaper on M4-class silicon) and DEEP CHAIN -76.9% (the same architectural weak spot
|
|
608
|
+
the honest framing has always named; recursive JS-stack computed resolution loses to
|
|
609
|
+
alien's flatter chain on hot new cores by a wider margin than on old Intel). On
|
|
610
|
+
allocation, lite wins 5/6 shapes and is one to four orders of magnitude below alien on
|
|
611
|
+
every shape where GC pressure exists at all.
|
|
612
|
+
|
|
613
|
+
**The differentiated position is ALLOCATION, not raw propagation speed** -- competitive
|
|
614
|
+
throughput with dramatically lower GC pressure, not "fastest dynamic-graph engine".
|
|
615
|
+
That headline reproduces across hosts, sweeps, and third-party version bumps because
|
|
616
|
+
the object pool is the mechanism, not a tuning knob.
|
|
617
|
+
|
|
618
|
+
Mirror sweep (`bench/r.txt`, Andrii's canonical adapter verbatim, isolated-per-row,
|
|
619
|
+
10 reps, lite vs alien only on the same M4 Pro host) reproduces the same picture
|
|
620
|
+
across all 47 shapes: lite runs parity-to-behind alien on throughput, wins outright
|
|
621
|
+
on 4/47 (`1000x5 - 25 sources (wide dense)` +12%,
|
|
622
|
+
`manySourcesIntoOneComputedEffectWithDirect` +32.5%, `manySourcesIntoOneComputedEffect`
|
|
623
|
+
+31.7%, and `createComputations4to1` +19.3%), weak on the deep/layered-burst family.
|
|
624
|
+
Every row carries a `#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` /
|
|
625
|
+
`sinkReads`) match Andrii's published suite exactly, so a lite-vs-alien delta here is
|
|
626
|
+
identical work, not DCE. Retracking verified correct by `retracking.difftest.mjs`
|
|
627
|
+
(20,000 direct + 10,000 batched writes, 0 disagreements vs published 1.1.5).
|
|
628
|
+
`prealloc: "lazy"` trades a little first-construction allocation on the dynamic shapes
|
|
629
|
+
for a smaller resident heap and faster cold start; steady state identical.
|
|
623
630
|
|
|
624
631
|
Retained heap after forced GC: typically negative for all libs (V8 compacts).
|
|
625
|
-
The one exception: lite-signal shows ~+
|
|
632
|
+
The one exception: lite-signal shows ~+23 KB retained on KAIROS, which is the
|
|
626
633
|
pre-allocated pool holding the live 1002-node graph in steady state. This is
|
|
627
634
|
the design: the pool IS the working memory. Not a leak.
|
|
628
635
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.5.0-beta.
|
|
3
|
+
"version": "1.5.0-beta.7",
|
|
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",
|