@zakkster/lite-signal 1.8.0-alpha.2 → 1.8.0-alpha.4
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 +83 -0
- package/README.md +59 -51
- package/llms.txt +65 -41
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ This project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
### Changed -- bench protocol v3 (carried forward)
|
|
10
|
+
|
|
11
|
+
The `bench/` harness is bench protocol v3: three instruments (microscope / mirror /
|
|
12
|
+
version-economics), each with a fixed config and a machine-generated `#STAMP`
|
|
13
|
+
(engine + harness sha256, live registry config, host, node). The pre-v3
|
|
14
|
+
five-framework reactivity suite was removed after 1.5.1. See `bench/README.md`.
|
|
15
|
+
|
|
16
|
+
### Added -- Coveralls coverage badge
|
|
17
|
+
|
|
18
|
+
README carries a Coveralls badge; lcov is produced by `npm run test:report`
|
|
19
|
+
(`coveralls-next` in devDependencies).
|
|
20
|
+
|
|
21
|
+
|
|
9
22
|
### Fixed -- dangling re-tracking cursor on source disposal (crash)
|
|
10
23
|
|
|
11
24
|
Disposing a signal/computed from inside an observer that had linked it on the
|
|
@@ -217,6 +230,76 @@ scheduler, or pool moved.
|
|
|
217
230
|
to 1.6.0-alpha's opcode 6/7 additions. The 1.8 minor introduces no new
|
|
218
231
|
hook-gate branches.
|
|
219
232
|
|
|
233
|
+
### Verified -- fresh 1.8.0 bench sweep (Apple M4 Pro / Node 26)
|
|
234
|
+
|
|
235
|
+
Both v3 instruments were re-run in full on the 1.8.0 engine on **Apple
|
|
236
|
+
M4 Pro darwin/arm64, Node 26.3.1**, with `#STAMP`-verified outputs
|
|
237
|
+
committed to `bench/r.txt` (microscope aggregate, 4 engines across the
|
|
238
|
+
six first-party shapes) and `bench/rb.txt` (mirror sweep, Andrii's
|
|
239
|
+
canonical adapter verbatim, lite vs alien across 47 rows,
|
|
240
|
+
isolated-per-row, 10 reps). Fresh Andrii 15-framework log at
|
|
241
|
+
`bench/AndriiVolynetsReactiveBench.log`.
|
|
242
|
+
|
|
243
|
+
- **Andrii Volynets js-reactivity-benchmark position moves from 4th to
|
|
244
|
+
3rd of 15** with geomean **95.4 ms**; lite is now ahead of 4th-place
|
|
245
|
+
@reactively (136.0, lite 1.43x faster) and 5th-place Preact Signals
|
|
246
|
+
(148.8, ~56% ahead), behind only alien-signals (77.5) and reflex
|
|
247
|
+
(89.7). **Outright-fastest-of-15 wins jumped to 20 shapes** (was 3 on
|
|
248
|
+
1.3.0 log, 4 on 1.7.0-preview): the eight canonical propagation shapes
|
|
249
|
+
(`avoidablePropagation`, `broadPropagation`, `deepPropagation`,
|
|
250
|
+
`diamond`, `mux`, `repeatedObservers`, `triangle`, `unstable`), all four
|
|
251
|
+
wide fan-in / fan-out shapes (`manyEffectsFromOneSource`,
|
|
252
|
+
`manySourcesIntoOneComputedEffect`,
|
|
253
|
+
`manySourcesIntoOneComputedEffectWithDirect`,
|
|
254
|
+
`manySourcesIntoOneDirectEffect`), `molBench`, and seven of the
|
|
255
|
+
rectangular / layered DAG shapes (`64x6`, `24x8`, `120x7`, `40x10`,
|
|
256
|
+
both `256->512x32 layered-dag` variants, and `10x10 dynamic component`).
|
|
257
|
+
Top-3 count: **29/47** (was 21 on 1.3.0). The dramatic wins jump is
|
|
258
|
+
driven by the same engine bytes across every propagation function
|
|
259
|
+
except `executeEffect`, which is where the 1.8.0 effect-cleanup-return
|
|
260
|
+
check landed.
|
|
261
|
+
- **Microscope aggregate on M4 Pro (r.txt):** on the six v3 microscope
|
|
262
|
+
shapes, lite wins vs alien on **MUX +34.3%** (fan-in), **SELECTIVE DAG
|
|
263
|
+
+19.3%**, **DYNAMIC DAG +16.8%**, and **BROADCAST +9.4%** (recovered
|
|
264
|
+
from +6.2% on 1.7.0-preview) -- the allocation-heavy dynamic shapes and
|
|
265
|
+
fan-in / fan-out. The wins hold within noise of the 1.7.0-preview M4 Pro
|
|
266
|
+
sweep despite the `executeEffect` change (one `typeof` per effect run,
|
|
267
|
+
off the mark/pull path). Alien ahead on **KAIROS -15.9%** (widened
|
|
268
|
+
slightly from -11.7% on 1.7.0-preview) and **DEEP CHAIN -72.6%** (the
|
|
269
|
+
architectural weak spot: recursive JS-stack computed resolution against
|
|
270
|
+
alien's flatter chain). Speed wins vs alien: **4/6**; heap wins:
|
|
271
|
+
**5/6** with the sixth being a shared-zero on BROADCAST.
|
|
272
|
+
- **Microscope heap (the actual story) on M4 Pro:** on every shape where
|
|
273
|
+
GC pressure exists at all, lite allocates **one to four orders of
|
|
274
|
+
magnitude less transient heap than alien** -- DEEP CHAIN 0.5 KB vs 1062
|
|
275
|
+
KB (>2000x, on the shape lite loses on time), MUX 0 KB vs 781 KB,
|
|
276
|
+
KAIROS 23 KB vs 802 KB (34.3x), DYNAMIC DAG 3.3 MB vs 59.8 MB (18.3x),
|
|
277
|
+
SELECTIVE DAG 7.7 MB vs 77.8 MB (10.0x). Against preact-signals and
|
|
278
|
+
solid-signals the heap gap is even wider on the fan-in / fan-out
|
|
279
|
+
family; solid allocates ~17 MB on MUX and ~16 MB on SELECTIVE DAG where
|
|
280
|
+
lite allocates 0 KB and 7.7 MB on the same shapes. The differentiated
|
|
281
|
+
position is ALLOCATION, not raw propagation speed -- competitive-to-
|
|
282
|
+
winning throughput with dramatically lower GC pressure, and that is
|
|
283
|
+
the headline that reproduces across hosts.
|
|
284
|
+
- **Mirror sweep on M4 Pro (rb.txt):** Andrii's canonical 47-shape suite
|
|
285
|
+
re-run isolated-per-row lite vs alien on M4 Pro reproduces the same
|
|
286
|
+
honest framing: lite runs **parity-to-behind alien on throughput**
|
|
287
|
+
across the head-to-head suite (wins outright on **4/47** --
|
|
288
|
+
`1000x5 - 25 sources (wide dense)` +12.0%,
|
|
289
|
+
`manySourcesIntoOneComputedEffectWithDirect` +31.1%,
|
|
290
|
+
`manySourcesIntoOneComputedEffect` +29.5%, and `molBench` +0.3%), weak
|
|
291
|
+
on the deep/layered-burst family. That head-to-head result and the
|
|
292
|
+
"3rd of 15 with 20 outright wins" both live on the same log and are
|
|
293
|
+
not contradictory: the outright-of-15 rankings look at each shape
|
|
294
|
+
across every framework in the field, so shapes where alien beats lite
|
|
295
|
+
by 20-30% but reflex beats both by another 10% and everyone else is
|
|
296
|
+
slower can still count as a lite outright win when measured that way.
|
|
297
|
+
- **Third-party engine versions carried forward** from the 1.7.0-preview
|
|
298
|
+
sweep (alien-signals 3.2.1, @preact/signals-core 1.14.2,
|
|
299
|
+
@vue/reactivity 3.5.35, solid-js 1.9.13). No peer bumps this cycle;
|
|
300
|
+
the deltas here are the 1.8 engine's own footprint (the `executeEffect`
|
|
301
|
+
change) plus host noise.
|
|
302
|
+
|
|
220
303
|
### Migration
|
|
221
304
|
|
|
222
305
|
- **Every existing user**: zero work needed. Effects that don't return a
|
package/README.md
CHANGED
|
@@ -5,32 +5,35 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@zakkster/lite-signal)
|
|
6
6
|
[](https://github.com/sponsors/PeshoVurtoleta)
|
|
7
7
|

|
|
8
|
-

|
|
9
9
|
[](https://bundlephobia.com/result?p=@zakkster/lite-signal)
|
|
10
10
|
[](https://www.npmjs.com/package/@zakkster/lite-signal)
|
|
11
11
|
[](https://www.npmjs.com/package/@zakkster/lite-signal)
|
|
12
|
+
[](https://coveralls.io/github/PeshoVurtoleta/lite-signal?branch=main)
|
|
12
13
|

|
|
13
14
|

|
|
14
15
|

|
|
15
16
|
[](./LICENSE)
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## 3rd of 15 on the community reactivity benchmark -- and the only zero-GC engine in the field
|
|
18
19
|
|
|
19
|
-
On the independent [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (Andrii Volynets' fork; 15 reactive libraries, 47 tests), `lite-signal` places **
|
|
20
|
+
On the independent [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (Andrii Volynets' fork; 15 reactive libraries, 47 tests), `lite-signal` **1.8.0** places **3rd overall by geomean (95.4 ms)** -- up from 4th on every prior sweep, clearing 4th-place @reactively (136.0) by ~43% and 5th-place Preact Signals (148.8) by ~56%, behind only alien-signals (77.5) and reflex (89.7).
|
|
20
21
|
|
|
21
22
|
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:
|
|
22
23
|
|
|
23
24
|
| vs | lite-signal is |
|
|
24
25
|
| ---------------------- | -------------- |
|
|
25
|
-
| **@
|
|
26
|
-
| **
|
|
27
|
-
| **
|
|
28
|
-
|
|
|
29
|
-
| **
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
| **@reactively** | **1.43x faster** |
|
|
27
|
+
| **Preact Signals** | **1.56x faster** (~56% ahead) |
|
|
28
|
+
| **@vue/reactivity** | **2.4x faster** |
|
|
29
|
+
| **Signia** | **3.2x faster** |
|
|
30
|
+
| **MobX** | **4.1x faster** |
|
|
31
|
+
| **@solidjs/signals** | **4.4x faster** |
|
|
32
|
+
| **SolidJS** | **7.7x faster** |
|
|
33
|
+
| reflex | 0.94x (~6% behind, 2nd place) |
|
|
34
|
+
| alien-signals | 0.81x (the field leader) |
|
|
35
|
+
|
|
36
|
+
`lite-signal` finishes **top-3 on 29 of the 47 tests** (up from 21 on the 1.3.0-era log) and is the **outright fastest of all 15** on **twenty shapes** -- the eight canonical propagation shapes (`avoidablePropagation`, `broadPropagation`, `deepPropagation`, `diamond`, `mux`, `repeatedObservers`, `triangle`, `unstable`), all four wide fan-in / fan-out shapes (`manyEffectsFromOneSource`, `manySourcesIntoOneComputedEffect`, `manySourcesIntoOneComputedEffectWithDirect`, `manySourcesIntoOneDirectEffect`), `molBench` (the mixed-app graph the suite uses as its realistic-workload proxy), and seven of the rectangular / layered DAG shapes (`64x6`, `24x8`, `120x7`, `40x10`, both `256->512x32 layered-dag` variants, and `10x10 dynamic component`). These are the aggregation and dynamic-DAG patterns that dominate live dashboards, scoreboards, and HUDs. The two engines ahead of it (alien-signals and reflex) are both push-eager designs that allocate on the hot path; `lite-signal` is the only top-3 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.)
|
|
34
37
|
|
|
35
38
|
```bash
|
|
36
39
|
npm install @zakkster/lite-signal
|
|
@@ -765,27 +768,29 @@ These are the questions you'd ask in a code review, with the answers:
|
|
|
765
768
|
|
|
766
769
|
## Benchmarks
|
|
767
770
|
|
|
768
|
-
Honest numbers, against the same workload, with anti-DCE sinks and verified effect execution. All measurements: Node
|
|
771
|
+
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.8.0 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.7.0 -> 1.8.0 changes the hot path only in `executeEffect` (the effect-cleanup-return check: one `typeof` per effect run, off the mark/pull path); sha256 over the 15 other function bodies is byte-identical between pristine 1.7.0-preview and pristine 1.8.0 (verified: `pullComputed`, `markDownstream`, `flushEffects`, `allocateLink`, `severTail`, `createNode`, `runCleanup`, `disposeNode`, `createRoot`, `createScope`, `flush`, `batch`, `signal`, `computed`, `effect`). Full outputs: [`bench/r.txt`](./bench/r.txt) (this microscope aggregate across four engines) and [`bench/rb.txt`](./bench/rb.txt) (the mirror sweep -- Andrii's canonical adapter verbatim, 47 rows, lite vs alien on the same M4 Pro host).
|
|
769
772
|
|
|
770
773
|
| Scenario | What it stresses | lite-signal | alien-signals | lite vs alien | transient heap (lite / alien) |
|
|
771
774
|
| ---------- | -------------------------------- | ----------- | ------------- | ------------- | ----------------------------- |
|
|
772
|
-
| **
|
|
773
|
-
| **
|
|
774
|
-
| **
|
|
775
|
-
| **
|
|
776
|
-
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect |
|
|
777
|
-
| **
|
|
778
|
-
| **WIDE DENSE** | 5 layers × ~200 wide, dense fan-in | 2850 ms | 2740 ms | -4% (parity) | **0.3 KB / 11.6 MB** (>=11605x less) |
|
|
779
|
-
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) | 1182 ms | 1074 ms | -10% | 72 KB / 21 KB |
|
|
780
|
-
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 401 ms | **339 ms** | -18% | 18 KB / 905 KB (49.7x less) |
|
|
775
|
+
| **MUX** | 256 signals -> 1 sum -> 1 effect (fan-in) | **23.00 ms** | 35.00 ms | **+34.3% faster** | **0 KB / 781 KB** (100% less) |
|
|
776
|
+
| **SELECTIVE DAG** | sqrt-layered, set churn, 2 read/iter | **2012 ms** | 2493 ms | **+19.3% faster** | **7.7 MB / 77.8 MB** (90.0% less, 10.0x) |
|
|
777
|
+
| **DYNAMIC DAG** | sqrt-layered, FAN=6, read flips each iter | **3700 ms** | 4448 ms | **+16.8% faster** | **3.3 MB / 59.8 MB** (94.5% less, 18.3x) |
|
|
778
|
+
| **BROADCAST** | 1 signal -> 1000 effects (fan-out) | **433.51 ms** | 478.35 ms | **+9.4% faster** | ~0 KB / ~0 KB (both fit under GC floor) |
|
|
779
|
+
| **KAIROS** | 1 signal -> 1000 computeds -> 1 effect | 502.01 ms | 433.19 ms | -15.9% | **23 KB / 802 KB** (97.1% less, 34.3x) |
|
|
780
|
+
| **DEEP CHAIN** | 256-deep computed chain -> 1 effect | 170.10 ms | **98.57 ms** | -72.6% | **0.5 KB / 1062 KB** (100% less, >2000x) |
|
|
781
781
|
|
|
782
782
|
*(lower time = faster; transient heap = average delta-heap per rep, lower = less GC pressure)*
|
|
783
783
|
|
|
784
|
-
**Reading the table:** lite-signal's time wins cluster exactly where its zero-GC design pays off -- the **allocation-heavy dynamic shapes** (**SELECTIVE DAG +
|
|
784
|
+
**Reading the table:** lite-signal's time wins cluster exactly where its zero-GC design pays off -- the **allocation-heavy dynamic shapes** (**SELECTIVE DAG +19.3%**, **DYNAMIC DAG +16.8%**), where alien-signals churns the nursery and lite's object pool allocates near-nothing, plus **MUX +34.3%** (fan-in aggregation) and **BROADCAST +9.4%** (fan-out; recovered from +6.2% on 1.7.0-preview). These are the patterns that dominate live UI workloads under input churn: dashboards, scoreboards, HUDs, leaderboards. That is **4 wins of 6** on time; on this sweep the wins hold within noise of the 1.7.0-preview M4 Pro sweep despite the 1.7.0 -> 1.8.0 `executeEffect` change, which is what "one `typeof` per effect run, off the mark/pull path" looks like in the propagation numbers. The two losses:
|
|
785
|
+
|
|
786
|
+
- **DEEP CHAIN (-72.6%)** is the engine's structurally worst shape and the largest open performance gap it has. On a 256-deep pull chain alien's flatter representation wins outright (99 ms vs 170 ms). It is not closed and it is not going to be closed by tuning. Note the inversion: **lite loses the row on time by 73% while allocating >2000x less heap**.
|
|
787
|
+
- **KAIROS (-15.9%)** widened from -11.7% on 1.7.0-preview: 1 source -> 1000 computeds has almost nothing to retrack, so the pooled representation pays its per-node indirection with no allocation saving to show for it.
|
|
788
|
+
|
|
789
|
+
On **allocation pressure** `lite-signal` wins **5 of 6** and is one to four orders of magnitude below alien on every shape where GC pressure exists at all: 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.3x), DYNAMIC DAG 3.3 MB vs 59.8 MB (18.3x), SELECTIVE DAG 7.7 MB vs 77.8 MB (10.0x). 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 ~16 MB on SELECTIVE DAG where lite allocates 0 KB and 7.7 MB respectively (`bench/r.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.
|
|
785
790
|
|
|
786
|
-
|
|
791
|
+
The mirror-sweep companion ([`bench/rb.txt`](./bench/rb.txt)) reproduces the picture across Andrii's 47 shapes on the same M4 Pro host: lite runs **parity-to-behind alien on throughput** across the head-to-head suite, wins outright on **4 of the 47** (`1000x5 - 25 sources (wide dense)` +12.0%, `manySourcesIntoOneComputedEffectWithDirect` +31.1%, `manySourcesIntoOneComputedEffect` +29.5%, and `molBench` +0.3%), weak on the deep/layered-burst family. That head-to-head result and the top-of-file "3rd of 15 with 20 outright wins" both live on the same log -- they are not contradictory: the outright-of-15 rankings look at each shape across every framework in the field, so shapes where alien beats lite by 20-30% but reflex beats both by another 10% and everyone else is slower can still count as a lite outright win when the leaderboard is measured that way.
|
|
787
792
|
|
|
788
|
-
> Note on the +
|
|
793
|
+
> 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.
|
|
789
794
|
|
|
790
795
|
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:
|
|
791
796
|
|
|
@@ -859,7 +864,7 @@ npm run test:gc
|
|
|
859
864
|
|
|
860
865
|
### Tier 3 -- Performance (comparative benchmark)
|
|
861
866
|
|
|
862
|
-
`npm run bench` runs the
|
|
867
|
+
`npm run bench` runs the **microscope** -- lite's recommended eager config on six first-party shapes; the aggregate output is [`bench/r.txt`](./bench/r.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/rb.txt`](./bench/rb.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 was **removed after 1.5.1** (bench protocol v3). Full methodology: [`bench/README.md`](./bench/README.md).
|
|
863
868
|
|
|
864
869
|
```bash
|
|
865
870
|
npm run bench
|
|
@@ -895,7 +900,7 @@ npm run verify # test + test:gc + a sanity bench
|
|
|
895
900
|
## Performance Trade-offs & Topology Scaling
|
|
896
901
|
|
|
897
902
|
<details>
|
|
898
|
-
<summary>Stable vs dynamic topologies; Andrii Volynets' matrix, the 1.1.4 result, the 1.
|
|
903
|
+
<summary>Stable vs dynamic topologies; Andrii Volynets' matrix, the 1.1.4 result, the 1.8.0 ranking, and the roadmap.</summary>
|
|
899
904
|
|
|
900
905
|
`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.
|
|
901
906
|
|
|
@@ -903,10 +908,10 @@ Through **v1.1.2**, that came with a mathematical trade-off: while memory alloca
|
|
|
903
908
|
|
|
904
909
|
**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.
|
|
905
910
|
|
|
906
|
-
**1.
|
|
911
|
+
**1.8.0 on the official [js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark) (15 libraries, 47 tests, raw log at [`bench/AndriiVolynetsReactiveBench.log`](./bench/AndriiVolynetsReactiveBench.log)):** `lite-signal` **moves into 3rd overall by geomean (95.4 ms)**, behind only alien-signals (77.5, the field leader at 0.81x) and reflex (89.7, 0.94x), and **ahead of 4th-place @reactively (136.0, 1.43x) and 5th-place Preact Signals (148.8, ~56%)**. It finishes **top-3 on 29 of 47 tests** and is the **outright fastest of all 15 on twenty shapes** -- the eight canonical propagation shapes (`avoidablePropagation`, `broadPropagation`, `deepPropagation`, `diamond`, `mux`, `repeatedObservers`, `triangle`, `unstable`), all four wide fan-in / fan-out shapes (`manyEffectsFromOneSource`, `manySourcesIntoOneComputedEffect`, `manySourcesIntoOneComputedEffectWithDirect`, `manySourcesIntoOneDirectEffect`), `molBench`, and seven of the rectangular / layered DAG shapes. This is a dramatic step from the 3 outright wins of the 1.3.0-era log and the 4 of 1.7.0-preview -- driven by the same engine bytes across every propagation function except `executeEffect`, which is where the 1.8.0 effect-cleanup-return check landed. It remains the only object-pooled, zero-GC engine in the field.
|
|
907
912
|
|
|
908
913
|
#### 1. Stable Topologies (Fan-in / Fan-out / Broadcast)
|
|
909
|
-
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.
|
|
914
|
+
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 and holding on 1.8.0.
|
|
910
915
|
|
|
911
916
|
#### 2. Dynamic Topologies (Web Apps / Layered DAGs) -- closed in 1.1.4
|
|
912
917
|
*Andrii's v1.1.2 baseline (his host) -- where the cursor retracking lost:*
|
|
@@ -916,27 +921,30 @@ In stable environments (game engines, particle systems, visualizers), `lite-sign
|
|
|
916
921
|
| **1000x5 (25 sources, wide/dense)** | 304ms | 303ms | 1746ms |
|
|
917
922
|
| **64x6 (selective dynamic DAG)** | 181ms | 196ms | 559ms |
|
|
918
923
|
|
|
919
|
-
*1.
|
|
920
|
-
| Scenario | alien-signals | lite-signal (1.
|
|
924
|
+
*1.8.0 (default eager) on the v3 microscope (`bench/r.txt`, Apple M4 Pro darwin/arm64, Node 26.3.1, one engine per cold process -- compare within-column, lite vs alien):*
|
|
925
|
+
| Scenario | alien-signals | lite-signal (1.8.0) | result |
|
|
921
926
|
| :--- | :--- | :--- | :--- |
|
|
922
|
-
| **
|
|
923
|
-
| **
|
|
924
|
-
| **
|
|
925
|
-
| **
|
|
926
|
-
| **
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
>
|
|
930
|
-
>
|
|
931
|
-
>
|
|
932
|
-
>
|
|
933
|
-
>
|
|
934
|
-
>
|
|
935
|
-
>
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
927
|
+
| **MUX** (256 sigs -> sum -> effect) | 35.00 ms | 23.00 ms | **lite +34.3%** |
|
|
928
|
+
| **SELECTIVE DAG** (sqrt-layered, set churn) | 2493 ms | 2012 ms | **lite +19.3%** |
|
|
929
|
+
| **DYNAMIC DAG** (sqrt-layered, FAN=6) | 4448 ms | 3700 ms | **lite +16.8%** |
|
|
930
|
+
| **BROADCAST** (1 -> 1000 effects) | 478.35 ms | 433.51 ms | **lite +9.4%** (recovered from +6.2% on 1.7.0-preview) |
|
|
931
|
+
| **KAIROS** (1 -> 1000 computeds) | 433.19 ms | 502.01 ms | alien +15.9% (widened from -11.7% on 1.7.0-preview) |
|
|
932
|
+
| **DEEP CHAIN** (256-deep pull) | 98.57 ms | 170.10 ms | **alien +72.6%** |
|
|
933
|
+
|
|
934
|
+
> **Honest note (1.8.0 isolated run):** measured one-engine-per-process, lite-signal's
|
|
935
|
+
> wins cluster on the **allocation-heavy** dynamic shapes and fan-in / fan-out (MUX
|
|
936
|
+
> +34.3%, SELECTIVE DAG +19.3%, DYNAMIC DAG +16.8%, BROADCAST +9.4%) -- exactly where
|
|
937
|
+
> alien churns the nursery and lite's pool allocates near-nothing. The wins hold within
|
|
938
|
+
> noise of the 1.7.0-preview M4 Pro sweep despite the 1.7.0 -> 1.8.0 `executeEffect`
|
|
939
|
+
> change (one `typeof` per effect run, off the mark/pull path); every other propagation
|
|
940
|
+
> function is sha256-identical between the two engines. **BROADCAST recovered** from
|
|
941
|
+
> +6.2% to +9.4%; **KAIROS widened** slightly from -11.7% to -15.9%. lite remains one
|
|
942
|
+
> to four orders of magnitude below alien on transient heap on every shape where GC
|
|
943
|
+
> pressure exists at all (see [`bench/r.txt`](./bench/r.txt)).
|
|
944
|
+
|
|
945
|
+
The mirror sweep ([`bench/rb.txt`](./bench/rb.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** across the head-to-head suite, wins outright on **4/47** (`1000x5 - 25 sources (wide dense)` +12.0%, `manySourcesIntoOneComputedEffectWithDirect` +31.1%, `manySourcesIntoOneComputedEffect` +29.5%, and `molBench` +0.3%), 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.
|
|
946
|
+
|
|
947
|
+
**The Takeaway:** as of 1.1.4 you no longer have to choose, and 1.8.0 pushes the ranking up -- the engine now ranks **3rd of 15** on the official js-reactivity-benchmark (up from 4th on every prior sweep) and is 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 microscope BROADCAST recovered from parity to a +9.4% win; KAIROS widened slightly. The one shape where alien's flatter representation still leads decisively is the 256-deep computed pipeline (DEEP CHAIN, -72.6% on the M4 Pro isolated run) -- and that gap is structural, not a tuning bug.
|
|
940
948
|
|
|
941
949
|
### Roadmap
|
|
942
950
|
- **1.1.5** -- additions in service of `lite-devtools` (node identity/traversability on the introspection walkers, for full auto-discovered graph rendering). *Shipped.*
|
|
@@ -1268,8 +1276,8 @@ Wired as `npm run test:harness`.
|
|
|
1268
1276
|
npm test # behavior suite, ~1.3s
|
|
1269
1277
|
npm run test:gc # zero-gc suite, requires --expose-gc, ~3s
|
|
1270
1278
|
npm run test:harness # profiler-tools hardening suite
|
|
1271
|
-
npm run bench #
|
|
1272
|
-
|
|
1279
|
+
npm run bench # microscope + mirror comparative benches (r.txt / rb.txt), ~5min
|
|
1280
|
+
node --expose-gc bench/mirror.mjs --self-verify # cross-framework mirror sweep (bench protocol v3)
|
|
1273
1281
|
npm run harness:smoke # flushStrategy semantics -- asserts
|
|
1274
1282
|
npm run harness:all # smoke + field + dispose + churn probes
|
|
1275
1283
|
npm run gate # cold-process version-matrix regression gate (also runs on prepublish)
|
package/llms.txt
CHANGED
|
@@ -238,7 +238,7 @@ triggering write -- no `queueMicrotask`, no promises, no scheduler ticks.
|
|
|
238
238
|
Version lineage:
|
|
239
239
|
this is the engine previously labeled `1.2.3` in dev -- renumbered to
|
|
240
240
|
`1.2.2` because the deletion is small, isolated, and intentionally
|
|
241
|
-
non-behavioral. Drop-in over 1.2.1. **Bench position** (third-party
|
|
241
|
+
non-behavioral. Drop-in over 1.2.1. **Bench harness (protocol v3):** rebuilt around three fixed-config instruments -- microscope (`benchmark.mjs`, recommended eager config, six first-party shapes), mirror (`mirror.mjs` + `sweep.mjs`, Andrii's canonical adapter verbatim, rows diff 1:1 against his log), version-economics (`harness/toe-to-toe`) -- each output carrying a machine-generated `#STAMP` (engine + harness sha256, live registry config, host, node). Pre-v3 five-framework suite removed after 1.5.1. Methodology in `bench/README.md`. **Bench position** (third-party
|
|
242
242
|
[js-reactivity-benchmark](https://github.com/volynetstyle/js-reactivity-benchmark),
|
|
243
243
|
15 frameworks, 47 tests): #4 by geomean (75.5) at 1.77x behind alien-signals
|
|
244
244
|
(1.00x), reflex (1.15x), @reactively (1.39x); now ahead of 5th-place Preact
|
|
@@ -528,48 +528,72 @@ None of these touch the reactive engine -- no `FLAG_WATCHER` on `ReactiveNode`,
|
|
|
528
528
|
|
|
529
529
|
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.
|
|
530
530
|
|
|
531
|
-
## Benchmark snapshot (Node
|
|
532
|
-
|
|
533
|
-
`benchmark.mjs` head-to-head vs
|
|
534
|
-
execution; heap = average transient delta-heap per rep;
|
|
535
|
-
@1.
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
|
541
|
-
|
|
|
542
|
-
|
|
|
543
|
-
|
|
|
544
|
-
|
|
|
545
|
-
|
|
|
546
|
-
|
|
|
547
|
-
| DEEP CHAIN (256-deep -> effect) |
|
|
548
|
-
|
|
549
|
-
lite-signal's time wins
|
|
550
|
-
near-nothing; alien churns the nursery), plus
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
531
|
+
## Benchmark snapshot (Node 26.3.1, Apple M4 Pro darwin/arm64, default eager, median across reps -- @1.8.0)
|
|
532
|
+
|
|
533
|
+
v3 microscope (`benchmark.mjs`, six first-party shapes, `bench/r.txt`) head-to-head vs
|
|
534
|
+
alien-signals (time = median execution; heap = average transient delta-heap per rep;
|
|
535
|
+
lite-signal numbers are @1.8.0, hot paths byte-identical to 1.7.0-preview except for
|
|
536
|
+
`executeEffect`, which added the effect-cleanup-return `typeof` check off the mark /
|
|
537
|
+
pull path; sha256 over the 15 other function bodies matches pristine 1.7.0-preview
|
|
538
|
+
byte-for-byte):
|
|
539
|
+
|
|
540
|
+
| Scenario | lite | alien | lite vs alien (time) | transient heap (lite / alien) |
|
|
541
|
+
| -------------------------------- | -------- | -------- | -------------------- | ----------------------------- |
|
|
542
|
+
| MUX (256 sigs -> sum -> effect) | 23.00 ms | 35.00 ms | **+34.3% faster** | 0 KB / 781 KB (100% less) |
|
|
543
|
+
| SELECTIVE DAG (set churn) | 2012 ms | 2493 ms | **+19.3% faster** | 7.7 MB / 77.8 MB (10.0x) |
|
|
544
|
+
| DYNAMIC DAG (FAN=6, read flips) | 3700 ms | 4448 ms | **+16.8% faster** | 3.3 MB / 59.8 MB (18.3x) |
|
|
545
|
+
| BROADCAST (1 -> 1000 effects) | 433.51 ms | 478.35 ms | **+9.4% faster** | ~0 KB / ~0 KB (both zero) |
|
|
546
|
+
| KAIROS (1 -> 1000 computeds) | 502.01 ms | 433.19 ms | -15.9% | 23 KB / 802 KB (34.3x) |
|
|
547
|
+
| DEEP CHAIN (256-deep -> effect) | 170.10 ms | 98.57 ms | **-72.6%** | 0.5 KB / 1062 KB (>2000x) |
|
|
548
|
+
|
|
549
|
+
lite-signal's time wins on the 1.8.0 M4 Pro sweep cluster on the allocation-heavy
|
|
550
|
+
dynamic shapes (object pool allocates near-nothing; alien churns the nursery), plus
|
|
551
|
+
MUX fan-in aggregation and BROADCAST -- the patterns that dominate live UI under
|
|
552
|
+
input churn. **Speed wins vs alien: 4/6** (MUX, SELECTIVE DAG, DYNAMIC DAG, BROADCAST).
|
|
553
|
+
The four wins hold within noise of the 1.7.0-preview M4 Pro sweep -- **BROADCAST
|
|
554
|
+
recovered** from +6.2% to +9.4%; **KAIROS widened** slightly from -11.7% to -15.9%,
|
|
555
|
+
consistent with 1000 shared-source computeds having almost nothing to retrack. **DEEP
|
|
556
|
+
CHAIN -72.6%** is the same architectural weak spot the honest framing has always
|
|
557
|
+
named. On allocation, lite wins 5/6 shapes and is one to four orders of magnitude
|
|
558
|
+
below alien on every shape where GC pressure exists at all; the sixth is a shared-
|
|
559
|
+
zero on BROADCAST.
|
|
560
|
+
|
|
561
|
+
**The differentiated position is ALLOCATION, not raw propagation speed** -- competitive-
|
|
562
|
+
to-winning throughput with dramatically lower GC pressure, not "fastest dynamic-graph
|
|
563
|
+
engine". That headline reproduces across hosts, sweeps, and third-party version bumps
|
|
564
|
+
because the object pool is the mechanism, not a tuning knob.
|
|
565
|
+
|
|
566
|
+
Mirror sweep (`bench/rb.txt`, Andrii's canonical adapter verbatim, isolated-per-row,
|
|
567
|
+
10 reps, lite vs alien only on the same M4 Pro host) reproduces the same picture
|
|
568
|
+
across all 47 shapes: lite runs parity-to-behind alien on throughput, wins outright
|
|
569
|
+
on **4/47**: `1000x5 - 25 sources (wide dense)` +12.0%,
|
|
570
|
+
`manySourcesIntoOneComputedEffectWithDirect` +31.1%, `manySourcesIntoOneComputedEffect`
|
|
571
|
+
+29.5%, and `molBench` +0.3%. Weak on the deep/layered-burst family. Every row carries
|
|
572
|
+
a `#STAMP` and the counters (`nodesRecomputed` / `edgesTraversed` / `sinkReads`) match
|
|
573
|
+
Andrii's published suite exactly, so a lite-vs-alien delta here is identical work,
|
|
574
|
+
not DCE. Retracking verified correct by `retracking.difftest.mjs` (20,000 direct +
|
|
575
|
+
10,000 batched writes, 0 disagreements vs published 1.1.5).
|
|
576
|
+
|
|
577
|
+
**Andrii Volynets js-reactivity-benchmark position: 3rd of 15** (up from 4th on every
|
|
578
|
+
prior sweep) with geomean **95.4 ms** (raw log `bench/AndriiVolynetsReactiveBench.log`).
|
|
579
|
+
Behind alien-signals (77.5), reflex (89.7). Ahead of @reactively (136.0, lite 1.43x
|
|
580
|
+
faster), Preact Signals (148.8, ~56%), uSignal (195.4), $mol_wire (206.5),
|
|
581
|
+
@amadeus-it-group/tans (210.4), @vue/reactivity (229.4, 2.4x), Oby (242.5), Signia
|
|
582
|
+
(307.0, 3.2x), MobX (388.3, 4.1x), @solidjs/signals (420.6, 4.4x), s-js (480.1),
|
|
583
|
+
SolidJS (733.5, 7.7x). **20 outright wins** (was 3 on 1.3.0 log, 4 on 1.7.0-preview):
|
|
584
|
+
the eight canonical propagation shapes (avoidablePropagation, broadPropagation,
|
|
585
|
+
deepPropagation, diamond, mux, repeatedObservers, triangle, unstable), all four wide
|
|
586
|
+
fan-in / fan-out shapes (manyEffectsFromOneSource, manySourcesIntoOneComputedEffect,
|
|
587
|
+
manySourcesIntoOneComputedEffectWithDirect, manySourcesIntoOneDirectEffect), molBench,
|
|
588
|
+
and seven of the rectangular / layered DAG shapes (64x6, 24x8, 120x7, 40x10, both
|
|
589
|
+
`256->512x32 layered-dag` variants, and 10x10 dynamic component). Top-3 count: 29/47
|
|
590
|
+
(was 21/47 on 1.3.0). The dramatic wins jump is driven by the same engine bytes across
|
|
591
|
+
every propagation function except `executeEffect`, which is where the 1.8.0 effect-
|
|
592
|
+
cleanup-return check landed. lite-signal is the only object-pooled, zero-GC engine in
|
|
593
|
+
the field.
|
|
570
594
|
|
|
571
595
|
Retained heap after forced GC: typically negative for all libs (V8 compacts).
|
|
572
|
-
The one exception: lite-signal shows ~+
|
|
596
|
+
The one exception: lite-signal shows ~+23 KB retained on KAIROS, which is the
|
|
573
597
|
pre-allocated pool holding the live 1002-node graph in steady state. This is
|
|
574
598
|
the design: the pool IS the working memory. Not a leak.
|
|
575
599
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-signal",
|
|
3
|
-
"version": "1.8.0-alpha.
|
|
3
|
+
"version": "1.8.0-alpha.4",
|
|
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",
|