@rasamjs/core 0.1.0 → 0.1.2

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.
@@ -1,29 +1,29 @@
1
1
  # Rasam vs SVG.js
2
2
 
3
- SVG.js 3.2.8; Rasam 0.1.0 workspace. CPU: Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz.
3
+ SVG.js 3.2.8; Rasam 0.1.2 workspace. CPU: Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz.
4
4
 
5
5
  All timings below are medians in milliseconds. Ratios above 1 mean Rasam took longer.
6
6
 
7
7
  | Browser | Workload | Nodes | Samples | Rasam | SVG.js | Rasam / SVG.js |
8
8
  | --- | --- | ---: | ---: | ---: | ---: | ---: |
9
- | chromium 156.0.8078.4 | creation | 2000 | 15 | 9.50 | 12.90 | 0.74 |
10
- | chromium 156.0.8078.4 | creation | 8000 | 15 | 34.60 | 40.90 | 0.85 |
11
- | chromium 156.0.8078.4 | fill | 1000 | 100 | 0.48 | 1.29 | 0.37 |
12
- | chromium 156.0.8078.4 | repeated-fill | 1000 | 100 | 0.67 | 3.66 | 0.18 |
13
- | chromium 156.0.8078.4 | pointer-one | 8000 | 40 | 3.92 | 3.64 | 1.08 |
14
- | chromium 156.0.8078.4 | pointer-all | 8000 | 40 | 3.88 | 3.64 | 1.07 |
15
- | firefox 157.0 | creation | 2000 | 15 | 21.00 | 22.00 | 0.95 |
16
- | firefox 157.0 | creation | 8000 | 15 | 85.00 | 80.00 | 1.06 |
17
- | firefox 157.0 | fill | 1000 | 100 | 1.20 | 1.50 | 0.80 |
18
- | firefox 157.0 | repeated-fill | 1000 | 100 | 1.60 | 4.50 | 0.36 |
19
- | firefox 157.0 | pointer-one | 8000 | 40 | 4.40 | 3.40 | 1.29 |
20
- | firefox 157.0 | pointer-all | 8000 | 40 | 4.20 | 3.40 | 1.24 |
21
- | webkit 27.2 | creation | 2000 | 15 | 13.00 | 17.00 | 0.76 |
22
- | webkit 27.2 | creation | 8000 | 15 | 54.00 | 72.00 | 0.75 |
23
- | webkit 27.2 | fill | 1000 | 100 | 0.70 | 1.70 | 0.41 |
24
- | webkit 27.2 | repeated-fill | 1000 | 100 | 0.90 | 5.10 | 0.18 |
25
- | webkit 27.2 | pointer-one | 8000 | 40 | 4.40 | 3.40 | 1.29 |
26
- | webkit 27.2 | pointer-all | 8000 | 40 | 4.40 | 3.40 | 1.29 |
9
+ | chromium 156.0.8078.4 | creation | 2000 | 15 | 9.70 | 12.20 | 0.80 |
10
+ | chromium 156.0.8078.4 | creation | 8000 | 15 | 36.50 | 45.10 | 0.81 |
11
+ | chromium 156.0.8078.4 | fill | 1000 | 100 | 0.50 | 1.39 | 0.36 |
12
+ | chromium 156.0.8078.4 | repeated-fill | 1000 | 100 | 0.71 | 4.23 | 0.17 |
13
+ | chromium 156.0.8078.4 | pointer-one | 8000 | 40 | 4.00 | 3.82 | 1.05 |
14
+ | chromium 156.0.8078.4 | pointer-all | 8000 | 40 | 4.02 | 3.80 | 1.06 |
15
+ | firefox 157.0 | creation | 2000 | 15 | 23.00 | 25.00 | 0.92 |
16
+ | firefox 157.0 | creation | 8000 | 15 | 93.00 | 85.00 | 1.09 |
17
+ | firefox 157.0 | fill | 1000 | 100 | 1.20 | 1.60 | 0.75 |
18
+ | firefox 157.0 | repeated-fill | 1000 | 100 | 1.70 | 5.00 | 0.34 |
19
+ | firefox 157.0 | pointer-one | 8000 | 40 | 4.40 | 3.80 | 1.16 |
20
+ | firefox 157.0 | pointer-all | 8000 | 40 | 4.60 | 3.80 | 1.21 |
21
+ | webkit 27.2 | creation | 2000 | 15 | 15.00 | 20.00 | 0.75 |
22
+ | webkit 27.2 | creation | 8000 | 15 | 56.00 | 73.00 | 0.77 |
23
+ | webkit 27.2 | fill | 1000 | 100 | 0.70 | 1.80 | 0.39 |
24
+ | webkit 27.2 | repeated-fill | 1000 | 100 | 1.35 | 6.85 | 0.20 |
25
+ | webkit 27.2 | pointer-one | 8000 | 40 | 4.40 | 3.60 | 1.22 |
26
+ | webkit 27.2 | pointer-all | 8000 | 40 | 4.20 | 3.60 | 1.17 |
27
27
 
28
28
  ## Methodology
29
29
 
@@ -1,13 +1,10 @@
1
1
  {
2
- "generatedAt": "2026-10-29T21:17:05.310Z",
3
- "revision": "d5ed3d67f128f008403aaf0769dc4a546e7a5362",
2
+ "generatedAt": "2026-11-02T00:13:40.368Z",
3
+ "revision": "cf520e325957ab98952540b7234db122a672d9ed",
4
4
  "dirtyTree": [
5
5
  "M packages/rasam/reports/adoption.json",
6
6
  " M packages/rasam/reports/creation.json",
7
- " M packages/rasam/reports/interchange-benchmark.json",
8
- " M packages/rasam/reports/size-parity.json",
9
- " M packages/rasam/reports/size.json",
10
- "?? SELECTION_PLAN.md"
7
+ " M packages/rasam/reports/interchange-benchmark.json"
11
8
  ],
12
9
  "sourceFiles": [
13
10
  {
@@ -88,7 +85,7 @@
88
85
  },
89
86
  {
90
87
  "path": "src/changes/restore.ts",
91
- "sha256": "d7b4c22efa09b09abf6310f0aff0e5f39405daf1cdca1a695fc3ae02188ea1fc"
88
+ "sha256": "a8ab84b53c4b11771af26f64e17c341862c6582756a3158796137c9c3f4ce47f"
92
89
  },
93
90
  {
94
91
  "path": "src/changes/service.ts",
@@ -292,7 +289,7 @@
292
289
  },
293
290
  {
294
291
  "path": "src/elements/text.ts",
295
- "sha256": "80756b99589ae7a32ff83e7e0b354b2322b6dc81d16e4eff1ef47e3e7b7c0b0b"
292
+ "sha256": "0d42353408aed12961785ac6dfff511b62ec76df77d075768cfbd138abc6e820"
296
293
  },
297
294
  {
298
295
  "path": "src/elements/tspan.ts",
@@ -468,7 +465,7 @@
468
465
  },
469
466
  {
470
467
  "path": "src/mixins/sizable.ts",
471
- "sha256": "2625e4ccba1559b1ca3d27e80a9840248b50179b3956b622d4e40eb1185d0fc3"
468
+ "sha256": "82c6a26c4a52bb5f225a38151e0ba3ab059b1dab58918d23fa63338aec2f1f1c"
472
469
  },
473
470
  {
474
471
  "path": "src/mixins/sizing-internals.ts",
@@ -604,7 +601,7 @@
604
601
  },
605
602
  {
606
603
  "path": "src/text/rich-textual.ts",
607
- "sha256": "a9b9cbcd3886f61dfc92ac8ca3f9b52dd7e68c534d3cfc33c0d8a318991064cd"
604
+ "sha256": "52dce3a3bb91da57261dec67b8682c020bbe1ea0f22eea7aa1c02e386eb610d2"
608
605
  },
609
606
  {
610
607
  "path": "src/text/types.ts",
@@ -656,7 +653,7 @@
656
653
  },
657
654
  {
658
655
  "path": "../../package-lock.json",
659
- "sha256": "6e3b4ef2ec17899f72a491bacd75361e36ab1d51aac654390c6b679798ec564c"
656
+ "sha256": "a9244a1f25a62dc4fd328605dbb09b0639edaaa42939757fdfbccc7cdea963f6"
660
657
  }
661
658
  ],
662
659
  "svgjs": "3.2.8",
@@ -9613,7 +9610,7 @@
9613
9610
  "size": {
9614
9611
  "fixture": "fixtures/size.ts",
9615
9612
  "rawBytes": 65967,
9616
- "gzipBytes": 19757,
9613
+ "gzipBytes": 19758,
9617
9614
  "budgetBytes": 20480,
9618
9615
  "included": [
9619
9616
  "src/changes/mutation.ts",
@@ -9663,7 +9660,7 @@
9663
9660
  },
9664
9661
  "performance": {
9665
9662
  "fixture": "scripts/benchmark.mjs",
9666
- "date": "2026-10-29T21:16:59.895Z",
9663
+ "date": "2026-11-02T00:13:34.754Z",
9667
9664
  "browser": "Chromium 156.0.8078.4",
9668
9665
  "node": "v24.21.0",
9669
9666
  "os": "win32 10.0.26200",
@@ -9672,29 +9669,28 @@
9672
9669
  "count": 1000,
9673
9670
  "warmup": 20,
9674
9671
  "iterations": 100,
9675
- "medianMs": 0.5999999940395355,
9676
- "p95Ms": 1,
9672
+ "medianMs": 0.5,
9673
+ "p95Ms": 0.699999988079071,
9677
9674
  "targetMedianMs": 16,
9678
9675
  "includes": "logical mutations and synchronous DOM commit; excludes paint",
9679
9676
  "timings": [
9677
+ 0.3999999761581421, 0.3999999761581421, 0.3999999761581421, 0.3999999761581421,
9678
+ 0.3999999761581421, 0.3999999761581421, 0.3999999761581421, 0.3999999761581421,
9679
+ 0.3999999761581421, 0.3999999761581421, 0.40000003576278687, 0.40000003576278687,
9680
+ 0.40000003576278687, 0.40000003576278687, 0.40000003576278687, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
9680
9681
  0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
9681
9682
  0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
9682
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9683
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9684
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9685
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9686
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9687
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9688
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9689
- 0.5999999940395355, 0.5999999940395355, 0.5999999940395355, 0.5999999940395355,
9690
- 0.5999999940395355, 0.5999999940395355, 0.6000000238418579, 0.6000000238418579,
9683
+ 0.5999999642372131, 0.5999999642372131, 0.5999999642372131, 0.5999999642372131,
9684
+ 0.5999999642372131, 0.5999999642372131, 0.5999999642372131, 0.5999999642372131,
9685
+ 0.5999999642372131, 0.5999999642372131, 0.5999999642372131, 0.5999999642372131,
9691
9686
  0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
9692
- 0.6000000238418579, 0.699999988079071, 0.699999988079071, 0.699999988079071,
9693
- 0.699999988079071, 0.699999988079071, 0.7000000178813934, 0.7000000178813934,
9694
- 0.7000000178813934, 0.7000000178813934, 0.7999999821186066, 0.7999999821186066,
9695
- 0.800000011920929, 0.800000011920929, 0.800000011920929, 0.9000000059604645,
9696
- 0.9000000059604645, 1, 1.0999999940395355, 1.100000023841858, 1.2000000178813934,
9697
- 1.399999976158142, 1.5
9687
+ 0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
9688
+ 0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
9689
+ 0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
9690
+ 0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579,
9691
+ 0.699999988079071, 0.699999988079071, 0.699999988079071, 0.699999988079071, 0.699999988079071,
9692
+ 0.7000000476837158, 0.7000000476837158, 0.800000011920929, 1.0999999642372131,
9693
+ 1.399999976158142
9698
9694
  ]
9699
9695
  }
9700
9696
  }
@@ -129,6 +129,8 @@ function applyChanges(
129
129
  throw error;
130
130
  }
131
131
  });
132
+ // Replay observers must capture the restored tree, not preflight's sibling order.
133
+ service.resetOrders();
132
134
  service.notifyReplay(
133
135
  direction === 'redo'
134
136
  ? changes
@@ -63,10 +63,10 @@ export class Text extends TextBase<SVGTextElement, TextAttributes> {
63
63
  leading(): number;
64
64
  leading(value: number): this;
65
65
  leading(value?: number): number | this {
66
+ this.assertLive();
67
+ const content = contentFor(this);
68
+ if (value === undefined) return content.leading;
66
69
  return mutation(this, () => {
67
- this.assertLive();
68
- const content = contentFor(this);
69
- if (value === undefined) return content.leading;
70
70
  if (!Number.isFinite(value) || value < 0)
71
71
  throw new RangeError('Leading must be finite and nonnegative');
72
72
  content.leading = value;
@@ -27,18 +27,18 @@ export const Sizable: MixinSizable = (BaseClass) => {
27
27
 
28
28
  width(): Length | null;
29
29
  width(value: Length): this;
30
+ // Reads skip change tracking: a tracked read captures sibling order, which made
31
+ // measuring n fresh siblings O(n²) while change listeners were attached.
30
32
  width(value?: Length): Length | null | this {
31
- return mutation(this, () => {
32
- return value === undefined ? this.dimension('width') : this.resize('width', value);
33
- });
33
+ if (value === undefined) return this.dimension('width');
34
+ return mutation(this, () => this.resize('width', value));
34
35
  }
35
36
 
36
37
  height(): Length | null;
37
38
  height(value: Length): this;
38
39
  height(value?: Length): Length | null | this {
39
- return mutation(this, () => {
40
- return value === undefined ? this.dimension('height') : this.resize('height', value);
41
- });
40
+ if (value === undefined) return this.dimension('height');
41
+ return mutation(this, () => this.resize('height', value));
42
42
  }
43
43
 
44
44
  size(width: Length, height?: Length): this {
@@ -65,9 +65,9 @@ export const RichTextual: MixinFactory<RichTextFeature, ParentNode> = (BaseClass
65
65
  text(): string;
66
66
  text(value: string): this;
67
67
  text(value?: string): string | this {
68
+ this.assertLive();
69
+ if (value === undefined) return this.#content.text();
68
70
  return mutation(this, () => {
69
- this.assertLive();
70
- if (value === undefined) return this.#content.text();
71
71
  this.#content.plain(value);
72
72
  return this;
73
73
  });