@sovereignbase/sequencer 0.0.0 → 0.0.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/README.md +45 -28
- package/dist/index.cjs +137 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +137 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,17 +26,17 @@ lifecycle workload and API throughput bursts. Full results are available for
|
|
|
26
26
|
[throughput](benchmark/.results/throughput.md).
|
|
27
27
|
|
|
28
28
|
Latest throughput results, measured on 12 October 2026. Latencies are in µs per
|
|
29
|
-
public API call, weighted by call count across
|
|
30
|
-
|
|
31
|
-
| Operation | 100 initial
|
|
32
|
-
| ----------------------------------- |
|
|
33
|
-
| `new Projection(actorID, sequence)` |
|
|
34
|
-
| `insert`, random position |
|
|
35
|
-
| `remove`, middle |
|
|
36
|
-
| `replace`, middle |
|
|
37
|
-
| `sequence()` |
|
|
38
|
-
| `value`, random position |
|
|
39
|
-
| `values()` |
|
|
29
|
+
public API call, weighted by call count across five runs.
|
|
30
|
+
|
|
31
|
+
| Operation | 100 initial insertions | 1,000 initial insertions | 10,000 initial insertions |
|
|
32
|
+
| ----------------------------------- | ---------------------: | -----------------------: | ------------------------: |
|
|
33
|
+
| `new Projection(actorID, sequence)` | 1.732 | 1.725 | 1.648 |
|
|
34
|
+
| `insert`, random position | 1.043 | 1.036 | 1.081 |
|
|
35
|
+
| `remove`, middle | 1.091 | 1.269 | 1.433 |
|
|
36
|
+
| `replace`, middle | 1.145 | 1.369 | 1.430 |
|
|
37
|
+
| `sequence()` | 0.353 | 0.390 | 0.363 |
|
|
38
|
+
| `value`, random position | 0.065 | 0.053 | 0.115 |
|
|
39
|
+
| `values()` | 4.352 | 147.965 | 1156.844 |
|
|
40
40
|
|
|
41
41
|
Environment: Node 24.16.0, V8 13.6.233.17-node.49, Windows x64, Intel Core
|
|
42
42
|
i5-10210U. Generated Strip lengths are 1–100 Frames. Each case warms up for
|
|
@@ -44,25 +44,25 @@ i5-10210U. Generated Strip lengths are 1–100 Frames. Each case warms up for
|
|
|
44
44
|
|
|
45
45
|
## Memory efficiency
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Retained-memory comparison for eight Projections, each containing 6,000
|
|
48
|
+
single-Frame insertions. These are five-run medians from isolated Node processes:
|
|
48
49
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
50
|
+
| Measurement | Before extension coalescing | Current |
|
|
51
|
+
| --------------------------- | --------------------------: | -------: |
|
|
52
|
+
| Additional JS heap after GC | 2.038 MB | 0.520 MB |
|
|
53
|
+
| Shared WASM memory capacity | 7.406 MB | 1.049 MB |
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
and grows as needed.
|
|
55
|
+
Module import and a small warm-up are excluded from the heap delta. WASM
|
|
56
|
+
capacity includes the initial 1 MiB allocation. These are not process RSS or
|
|
57
|
+
per-Projection total memory. Measurements and complete before/after results are
|
|
58
|
+
retained in [the optimization report](archives/optimizations/flat_sequence/README.md).
|
|
59
59
|
|
|
60
60
|
### Moderate bundle size
|
|
61
61
|
|
|
62
62
|
| Format | Raw | Minified | Minified + gzip |
|
|
63
63
|
| -------- | -------: | -------: | --------------: |
|
|
64
|
-
| ESM |
|
|
65
|
-
| CommonJS |
|
|
64
|
+
| ESM | 117.9 kB | 99.7 kB | 36.4 kB |
|
|
65
|
+
| CommonJS | 118.0 kB | 100.6 kB | 36.6 kB |
|
|
66
66
|
|
|
67
67
|
Both bundles include the WASM module. Minified sizes use Terser with three
|
|
68
68
|
compression passes; source maps and type declarations are excluded. kB and MB
|
|
@@ -75,18 +75,35 @@ framing or content. Numeric metadata accepts `Uint32Array` and JSON numeric
|
|
|
75
75
|
arrays. Generic content, called Footage, stays in JavaScript; only numeric
|
|
76
76
|
metadata enters WASM.
|
|
77
77
|
|
|
78
|
+
`sequence()` returns `[words, footage]`: one numeric array and one content
|
|
79
|
+
array, with no nested insertion or acknowledgement arrays. `words[0]` locates
|
|
80
|
+
the first six-word insertion record; preceding acknowledgements are length
|
|
81
|
+
prefixed. Positive insertion lengths identify successive spans of `footage`.
|
|
82
|
+
An empty Sequence is `[[], []]`. Construction and `merge()` accept numeric
|
|
83
|
+
arrays or `Uint32Array` metadata; exported numeric arrays can be sent as JSON.
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
const retained = projection.sequence()
|
|
87
|
+
const restored = new Projection<string>(2, retained)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Consecutive local insertions extend an intact insertion from the same Session
|
|
91
|
+
without reserving another zero in its logical clock. Gossip contains only the
|
|
92
|
+
new suffix, still using six structural words. A removal or fragmentation ends
|
|
93
|
+
the local extension chain. Retained snapshots remain unchanged by later edits.
|
|
94
|
+
|
|
78
95
|
Measured JSON transport sizes for 1,000 one-Frame insertions containing `'x'`,
|
|
79
96
|
their removal Gossip, and a snapshot captured before removal:
|
|
80
97
|
|
|
81
98
|
| Workload | Average bytes per operation or insertion | JSON | JSON + gzip | gzip reduction |
|
|
82
99
|
| ---------------------------------------------- | ---------------------------------------: | ------: | ----------: | -------------: |
|
|
83
|
-
| 1,000 one-frame insertions | 44.
|
|
84
|
-
| 1,000 one-frame removals |
|
|
85
|
-
| Snapshot containing 1,000 one-frame insertions |
|
|
100
|
+
| 1,000 one-frame insertions | 44.8 B | 45.8 kB | 5.1 kB | 88.9% |
|
|
101
|
+
| 1,000 one-frame removals | 67.8 B | 68.8 kB | 7.7 kB | 88.9% |
|
|
102
|
+
| Snapshot containing 1,000 one-frame insertions | 4.0 B | 4.0 kB | 0.1 kB | 98.3% |
|
|
86
103
|
|
|
87
104
|
Gossip sizes include acknowledgements and content where present. Delta averages
|
|
88
105
|
measure individual Gossip packets; batch totals include their enclosing array.
|
|
89
|
-
Snapshot averages divide the complete Sequence size by
|
|
106
|
+
Snapshot averages divide the complete Sequence size by the 1,000 authored insertions. Consecutive insertions are retained as one insertion.
|
|
90
107
|
Sizes vary with Session IDs and content.
|
|
91
108
|
|
|
92
109
|
## Tests
|
|
@@ -97,7 +114,7 @@ Sizes vary with Session IDs and content.
|
|
|
97
114
|
typechecks tests, runs unit, convergence, integration and generative stress suites
|
|
98
115
|
with V8 coverage, then runs runtime and browser compatibility checks.
|
|
99
116
|
|
|
100
|
-
The latest verification passed
|
|
117
|
+
The latest verification passed 167 Vitest tests and 88 compatibility checks.
|
|
101
118
|
Convergence tests include 1,024 generated editing histories for each compaction
|
|
102
119
|
mode. See the [test suites](test/README.md) and
|
|
103
120
|
[automated test report](https://sovereignbase.dev/sequencer/tests/).
|