@fjell/registry 4.4.6 → 4.4.9
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 +81 -4
- package/dist/Registry.cjs +20 -1
- package/dist/Registry.js +20 -1
- package/dist/RegistryHub.cjs +17 -1
- package/dist/RegistryHub.js +17 -1
- package/dist/index.cjs +35 -0
- package/dist/index.cjs.map +1 -1
- package/dist/types.d.ts +15 -0
- package/docs/README.md +74 -0
- package/docs/index.html +17 -0
- package/docs/memory-data/scaling-10-instances.json +206 -206
- package/docs/memory-data/scaling-100-instances.json +206 -206
- package/docs/memory-data/scaling-1000-instances.json +108 -108
- package/docs/memory-data/scaling-10000-instances.json +49 -49
- package/docs/memory-data/scaling-20-instances.json +208 -208
- package/docs/memory-data/scaling-200-instances.json +201 -201
- package/docs/memory-data/scaling-2000-instances.json +107 -107
- package/docs/memory-data/scaling-50-instances.json +206 -206
- package/docs/memory-data/scaling-500-instances.json +108 -108
- package/docs/memory-data/scaling-5000-instances.json +49 -49
- package/docs/memory-overhead.svg +17 -17
- package/docs/memory.md +111 -111
- package/docs/package.json +35 -0
- package/docs/public/README.md +623 -0
- package/docs/public/TIMING_NODE_OPTIMIZATION.md +207 -0
- package/docs/public/examples/coordinates-example.ts +253 -0
- package/docs/public/examples/multi-level-keys.ts +374 -0
- package/docs/public/examples/registry-hub-coordinates-example.ts +370 -0
- package/docs/public/examples/registry-hub-types.ts +437 -0
- package/docs/public/examples/simple-example.ts +250 -0
- package/docs/public/examples-README.md +222 -0
- package/docs/public/fjell-icon.svg +1 -0
- package/docs/public/icon.png +0 -0
- package/docs/public/icon2.png +0 -0
- package/docs/public/memory-overhead.svg +120 -0
- package/docs/public/memory.md +430 -0
- package/docs/public/pano.png +0 -0
- package/docs/public/pano2.png +0 -0
- package/docs/public/timing-range.svg +176 -0
- package/docs/public/timing.md +483 -0
- package/docs/src/App.css +1175 -0
- package/docs/src/App.test.tsx +50 -0
- package/docs/src/App.tsx +583 -0
- package/docs/src/index.css +40 -0
- package/docs/src/main.tsx +10 -0
- package/docs/src/test/setup.ts +1 -0
- package/docs/timing-range.svg +41 -41
- package/docs/timing.md +101 -101
- package/docs/tsconfig.node.json +13 -0
- package/docs/vitest.config.ts +14 -0
- package/examples/README.md +35 -0
- package/examples/coordinates-example.ts +253 -0
- package/examples/registry-hub-coordinates-example.ts +370 -0
- package/package.json +2 -2
package/docs/timing-range.svg
CHANGED
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
<g transform="translate(110,60)">
|
|
32
32
|
|
|
33
33
|
<!-- Grid lines (logarithmic scale) -->
|
|
34
|
-
<line x1="0" y1="
|
|
35
|
-
<text x="-10" y="
|
|
36
|
-
<line x1="0" y1="
|
|
37
|
-
<text x="-10" y="
|
|
38
|
-
<line x1="0" y1="
|
|
39
|
-
<text x="-10" y="
|
|
40
|
-
<line x1="0" y1="
|
|
41
|
-
<text x="-10" y="
|
|
42
|
-
<line x1="0" y1="
|
|
43
|
-
<text x="-10" y="
|
|
44
|
-
<line x1="0" y1="
|
|
45
|
-
<text x="-10" y="
|
|
34
|
+
<line x1="0" y1="414.21183286644987" x2="1015" y2="414.21183286644987" class="grid"/>
|
|
35
|
+
<text x="-10" y="418.21183286644987" text-anchor="end" class="label">0.10µs</text>
|
|
36
|
+
<line x1="0" y1="359.62470346155027" x2="1015" y2="359.62470346155027" class="grid"/>
|
|
37
|
+
<text x="-10" y="363.62470346155027" text-anchor="end" class="label">0.20µs</text>
|
|
38
|
+
<line x1="0" y1="287.46444348196144" x2="1015" y2="287.46444348196144" class="grid"/>
|
|
39
|
+
<text x="-10" y="291.46444348196144" text-anchor="end" class="label">0.50µs</text>
|
|
40
|
+
<line x1="0" y1="232.87731407706184" x2="1015" y2="232.87731407706184" class="grid"/>
|
|
41
|
+
<text x="-10" y="236.87731407706184" text-anchor="end" class="label">1.0µs</text>
|
|
42
|
+
<line x1="0" y1="178.29018467216224" x2="1015" y2="178.29018467216224" class="grid"/>
|
|
43
|
+
<text x="-10" y="182.29018467216224" text-anchor="end" class="label">2.0µs</text>
|
|
44
|
+
<line x1="0" y1="106.12992469257341" x2="1015" y2="106.12992469257341" class="grid"/>
|
|
45
|
+
<text x="-10" y="110.12992469257341" text-anchor="end" class="label">5.0µs</text>
|
|
46
46
|
<line x1="0" y1="0" x2="0" y2="460" class="grid"/>
|
|
47
47
|
<text x="0" y="480" text-anchor="middle" class="label">10</text>
|
|
48
48
|
<line x1="76.38636139973525" y1="0" x2="76.38636139973525" y2="460" class="grid"/>
|
|
@@ -78,34 +78,34 @@
|
|
|
78
78
|
<!-- Axis labels -->
|
|
79
79
|
<text x="507.5" y="510" text-anchor="middle" class="axis-title">Tree Size (items) - Log Scale</text>
|
|
80
80
|
<text transform="rotate(-90,-70,230)" x="-70" y="230" text-anchor="middle" class="axis-title">Execution Time (µs)</text>
|
|
81
|
-
<path d="M 0
|
|
82
|
-
<path d="M 0
|
|
83
|
-
<circle cx="0" cy="
|
|
84
|
-
<circle cx="76.38636139973525" cy="
|
|
85
|
-
<circle cx="177.36363860026475" cy="
|
|
86
|
-
<circle cx="253.75" cy="
|
|
87
|
-
<circle cx="330.1363613997352" cy="
|
|
88
|
-
<circle cx="431.1136386002648" cy="
|
|
89
|
-
<circle cx="507.5" cy="
|
|
90
|
-
<circle cx="583.8863613997353" cy="
|
|
91
|
-
<circle cx="684.8636386002647" cy="
|
|
92
|
-
<circle cx="761.25" cy="
|
|
93
|
-
<circle cx="837.6363613997353" cy="
|
|
94
|
-
<circle cx="938.6136386002647" cy="
|
|
95
|
-
<circle cx="1015" cy="
|
|
96
|
-
<circle cx="0" cy="
|
|
97
|
-
<circle cx="76.38636139973525" cy="
|
|
98
|
-
<circle cx="177.36363860026475" cy="
|
|
99
|
-
<circle cx="253.75" cy="
|
|
100
|
-
<circle cx="330.1363613997352" cy="
|
|
101
|
-
<circle cx="431.1136386002648" cy="
|
|
102
|
-
<circle cx="507.5" cy="
|
|
103
|
-
<circle cx="583.8863613997353" cy="
|
|
104
|
-
<circle cx="684.8636386002647" cy="
|
|
105
|
-
<circle cx="761.25" cy="
|
|
106
|
-
<circle cx="837.6363613997353" cy="
|
|
107
|
-
<circle cx="938.6136386002647" cy="
|
|
108
|
-
<circle cx="1015" cy="
|
|
81
|
+
<path d="M 0 54.5871294048996 L 76.38636139973525 204.52223211454054 L 177.36363860026475 106.51935671032135 L 253.75 195.52814972290633 L 330.1363613997352 113.59480588788551 L 431.1136386002648 163.00101388142247 L 507.5 168.64530111783552 L 583.8863613997353 168.02389006721552 L 684.8636386002647 181.3006947529126 L 761.25 184.74259304128134 L 837.6363613997353 223.36673887164602 L 938.6136386002647 205.81985515489995 L 1015 213.90171946899312" class="register-mean"/>
|
|
82
|
+
<path d="M 0 384.9149488624966 L 76.38636139973525 389.00373120422694 L 177.36363860026475 398.33522029914974 L 253.75 405.4128705951004 L 330.1363613997352 403.43324668188495 L 431.1136386002648 395.4950539384694 L 507.5 378.3221393445412 L 583.8863613997353 349.59171308701286 L 684.8636386002647 357.5457555145213 L 761.25 309.89073610809453 L 837.6363613997353 343.0099722607768 L 938.6136386002647 344.3996689209627 L 1015 339.77636216178064" class="lookup-mean"/>
|
|
83
|
+
<circle cx="0" cy="54.5871294048996" r="4" class="register-dot"/>
|
|
84
|
+
<circle cx="76.38636139973525" cy="204.52223211454054" r="4" class="register-dot"/>
|
|
85
|
+
<circle cx="177.36363860026475" cy="106.51935671032135" r="4" class="register-dot"/>
|
|
86
|
+
<circle cx="253.75" cy="195.52814972290633" r="4" class="register-dot"/>
|
|
87
|
+
<circle cx="330.1363613997352" cy="113.59480588788551" r="4" class="register-dot"/>
|
|
88
|
+
<circle cx="431.1136386002648" cy="163.00101388142247" r="4" class="register-dot"/>
|
|
89
|
+
<circle cx="507.5" cy="168.64530111783552" r="4" class="register-dot"/>
|
|
90
|
+
<circle cx="583.8863613997353" cy="168.02389006721552" r="4" class="register-dot"/>
|
|
91
|
+
<circle cx="684.8636386002647" cy="181.3006947529126" r="4" class="register-dot"/>
|
|
92
|
+
<circle cx="761.25" cy="184.74259304128134" r="4" class="register-dot"/>
|
|
93
|
+
<circle cx="837.6363613997353" cy="223.36673887164602" r="4" class="register-dot"/>
|
|
94
|
+
<circle cx="938.6136386002647" cy="205.81985515489995" r="4" class="register-dot"/>
|
|
95
|
+
<circle cx="1015" cy="213.90171946899312" r="4" class="register-dot"/>
|
|
96
|
+
<circle cx="0" cy="384.9149488624966" r="4" class="lookup-dot"/>
|
|
97
|
+
<circle cx="76.38636139973525" cy="389.00373120422694" r="4" class="lookup-dot"/>
|
|
98
|
+
<circle cx="177.36363860026475" cy="398.33522029914974" r="4" class="lookup-dot"/>
|
|
99
|
+
<circle cx="253.75" cy="405.4128705951004" r="4" class="lookup-dot"/>
|
|
100
|
+
<circle cx="330.1363613997352" cy="403.43324668188495" r="4" class="lookup-dot"/>
|
|
101
|
+
<circle cx="431.1136386002648" cy="395.4950539384694" r="4" class="lookup-dot"/>
|
|
102
|
+
<circle cx="507.5" cy="378.3221393445412" r="4" class="lookup-dot"/>
|
|
103
|
+
<circle cx="583.8863613997353" cy="349.59171308701286" r="4" class="lookup-dot"/>
|
|
104
|
+
<circle cx="684.8636386002647" cy="357.5457555145213" r="4" class="lookup-dot"/>
|
|
105
|
+
<circle cx="761.25" cy="309.89073610809453" r="4" class="lookup-dot"/>
|
|
106
|
+
<circle cx="837.6363613997353" cy="343.0099722607768" r="4" class="lookup-dot"/>
|
|
107
|
+
<circle cx="938.6136386002647" cy="344.3996689209627" r="4" class="lookup-dot"/>
|
|
108
|
+
<circle cx="1015" cy="339.77636216178064" r="4" class="lookup-dot"/>
|
|
109
109
|
<!-- Legend -->
|
|
110
110
|
<g transform="translate(20, 20)">
|
|
111
111
|
<rect x="0" y="0" width="190" height="80" fill="white" stroke="#ccc" stroke-width="1"/>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
<text x="0" y="0" class="metadata-section">System Information</text>
|
|
133
133
|
|
|
134
134
|
<text x="0" y="25" class="metadata-label">Test Date:</text>
|
|
135
|
-
<text x="150" y="25" class="metadata-value">2025-07-
|
|
135
|
+
<text x="150" y="25" class="metadata-value">2025-07-21</text>
|
|
136
136
|
|
|
137
137
|
<text x="0" y="45" class="metadata-label">Package Version:</text>
|
|
138
138
|
<text x="150" y="45" class="metadata-value">@fjell/registry v4.4.5</text>
|
package/docs/timing.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Performance Timing Report
|
|
2
2
|
|
|
3
|
-
Generated: 2025-07-
|
|
4
|
-
Version: 4.4.
|
|
3
|
+
Generated: 2025-07-21T04:04:11.800Z
|
|
4
|
+
Version: 4.4.7
|
|
5
5
|
Node.js: v22.0.0
|
|
6
6
|
Platform: darwin arm64
|
|
7
7
|
|
|
@@ -15,43 +15,43 @@ Timing results are reported in microseconds (µs) for precision.
|
|
|
15
15
|
|
|
16
16
|
| Operation | Description | Avg Time (µs) | Min Time (µs) | Max Time (µs) | Threshold (µs) | Status |
|
|
17
17
|
|-----------|-------------|---------------|---------------|---------------|----------------|--------|
|
|
18
|
-
| createRegistry | Time to create a new registry | 0.2 | 0.0 |
|
|
19
|
-
| createRegistryHub | Time to create a new registry hub | 0.1 | 0.0 |
|
|
20
|
-
| createInstance | Time to create a new instance | 1.0 | 0.2 |
|
|
21
|
-
| registerInstance | Time to register an instance in registry | 6.
|
|
22
|
-
| lookupInstance | Time to lookup an existing instance from registry | 0.
|
|
23
|
-
| completeWorkflow | Time for complete workflow: create hub, registry, instance, register, and lookup | 6.4 | 2.1 |
|
|
18
|
+
| createRegistry | Time to create a new registry | 0.2 | 0.0 | 558.5 | 5000 | ✅ PASS |
|
|
19
|
+
| createRegistryHub | Time to create a new registry hub | 0.1 | 0.0 | 321.1 | 5000 | ✅ PASS |
|
|
20
|
+
| createInstance | Time to create a new instance | 1.0 | 0.2 | 3170.4 | 10000 | ✅ PASS |
|
|
21
|
+
| registerInstance | Time to register an instance in registry | 6.9 | 0.8 | 40163.7 | 5000 | ✅ PASS |
|
|
22
|
+
| lookupInstance | Time to lookup an existing instance from registry | 0.5 | 0.1 | 2411.6 | 2000 | ✅ PASS |
|
|
23
|
+
| completeWorkflow | Time for complete workflow: create hub, registry, instance, register, and lookup | 6.4 | 2.1 | 8119.5 | 25000 | ✅ PASS |
|
|
24
24
|
|
|
25
25
|
## Scaling Performance Tests
|
|
26
26
|
|
|
27
27
|
| Operation | Tree Size | Avg Time (µs) | Min Time (µs) | Max Time (µs) | Threshold (µs) | Status |
|
|
28
28
|
|-----------|-----------|---------------|---------------|---------------|----------------|--------|
|
|
29
|
-
| registerInstance_10 | 10 | 2.
|
|
30
|
-
| lookupInstance_10 | 10 | 0.2 | 0.0 |
|
|
31
|
-
| registerInstance_20 | 20 |
|
|
32
|
-
| lookupInstance_20 | 20 | 0.
|
|
33
|
-
| registerInstance_50 | 50 |
|
|
34
|
-
| lookupInstance_50 | 50 | 0.
|
|
35
|
-
| registerInstance_100 | 100 |
|
|
36
|
-
| lookupInstance_100 | 100 | 0.
|
|
37
|
-
| registerInstance_200 | 200 | 1.
|
|
38
|
-
| lookupInstance_200 | 200 | 0.
|
|
39
|
-
| registerInstance_500 | 500 | 1.
|
|
40
|
-
| lookupInstance_500 | 500 | 0.
|
|
41
|
-
| registerInstance_1000 | 1000 |
|
|
42
|
-
| lookupInstance_1000 | 1000 | 0.2 | 0.0 |
|
|
43
|
-
| registerInstance_2000 | 2000 |
|
|
44
|
-
| lookupInstance_2000 | 2000 | 0.2 | 0.
|
|
45
|
-
| registerInstance_5000 | 5000 | 1
|
|
46
|
-
| lookupInstance_5000 | 5000 |
|
|
47
|
-
| registerInstance_10000 | 10000 |
|
|
48
|
-
| lookupInstance_10000 | 10000 | 0.
|
|
49
|
-
| registerInstance_20000 | 20000 | 1.2 | 0.9 |
|
|
50
|
-
| lookupInstance_20000 | 20000 | 0.3 | 0.
|
|
51
|
-
| registerInstance_50000 | 50000 | 1.
|
|
52
|
-
| lookupInstance_50000 | 50000 | 0.2 | 0.1 | 3
|
|
53
|
-
| registerInstance_100000 | 100000 | 1.
|
|
54
|
-
| lookupInstance_100000 | 100000 | 0.
|
|
29
|
+
| registerInstance_10 | 10 | 2.5 | 0.9 | 8034.8 | 5000 | ✅ PASS |
|
|
30
|
+
| lookupInstance_10 | 10 | 0.2 | 0.0 | 87.8 | 2000 | ✅ PASS |
|
|
31
|
+
| registerInstance_20 | 20 | 2.1 | 0.8 | 6723.3 | 5000 | ✅ PASS |
|
|
32
|
+
| lookupInstance_20 | 20 | 0.1 | 0.0 | 31.5 | 2000 | ✅ PASS |
|
|
33
|
+
| registerInstance_50 | 50 | 2.4 | 0.8 | 3273.2 | 5000 | ✅ PASS |
|
|
34
|
+
| lookupInstance_50 | 50 | 0.1 | 0.0 | 446.4 | 2000 | ✅ PASS |
|
|
35
|
+
| registerInstance_100 | 100 | 2.0 | 0.8 | 3239.7 | 5000 | ✅ PASS |
|
|
36
|
+
| lookupInstance_100 | 100 | 0.1 | 0.0 | 36.8 | 2000 | ✅ PASS |
|
|
37
|
+
| registerInstance_200 | 200 | 1.9 | 0.8 | 3083.9 | 10000 | ✅ PASS |
|
|
38
|
+
| lookupInstance_200 | 200 | 0.1 | 0.0 | 12.0 | 5000 | ✅ PASS |
|
|
39
|
+
| registerInstance_500 | 500 | 1.8 | 0.8 | 1154.4 | 10000 | ✅ PASS |
|
|
40
|
+
| lookupInstance_500 | 500 | 0.5 | 0.0 | 6698.5 | 5000 | ✅ PASS |
|
|
41
|
+
| registerInstance_1000 | 1000 | 3.3 | 0.8 | 7510.2 | 10000 | ✅ PASS |
|
|
42
|
+
| lookupInstance_1000 | 1000 | 0.2 | 0.0 | 138.5 | 5000 | ✅ PASS |
|
|
43
|
+
| registerInstance_2000 | 2000 | 3.1 | 1.1 | 370.3 | 20000 | ✅ PASS |
|
|
44
|
+
| lookupInstance_2000 | 2000 | 0.2 | 0.1 | 8.5 | 10000 | ✅ PASS |
|
|
45
|
+
| registerInstance_5000 | 5000 | 2.1 | 1.1 | 379.8 | 20000 | ✅ PASS |
|
|
46
|
+
| lookupInstance_5000 | 5000 | 0.2 | 0.1 | 4.3 | 10000 | ✅ PASS |
|
|
47
|
+
| registerInstance_10000 | 10000 | 2.3 | 0.9 | 1541.2 | 20000 | ✅ PASS |
|
|
48
|
+
| lookupInstance_10000 | 10000 | 0.4 | 0.1 | 35.2 | 10000 | ✅ PASS |
|
|
49
|
+
| registerInstance_20000 | 20000 | 1.2 | 0.9 | 22.7 | 50000 | ✅ PASS |
|
|
50
|
+
| lookupInstance_20000 | 20000 | 0.3 | 0.0 | 29.1 | 25000 | ✅ PASS |
|
|
51
|
+
| registerInstance_50000 | 50000 | 1.4 | 0.9 | 37.1 | 50000 | ✅ PASS |
|
|
52
|
+
| lookupInstance_50000 | 50000 | 0.2 | 0.1 | 2.3 | 25000 | ✅ PASS |
|
|
53
|
+
| registerInstance_100000 | 100000 | 1.5 | 1.0 | 44.6 | 50000 | ✅ PASS |
|
|
54
|
+
| lookupInstance_100000 | 100000 | 0.3 | 0.1 | 2.4 | 25000 | ✅ PASS |
|
|
55
55
|
|
|
56
56
|
## Scaling Performance Visualization
|
|
57
57
|
|
|
@@ -73,7 +73,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
73
73
|
**Iterations:** 20000
|
|
74
74
|
**Average Time:** 0.2 µs
|
|
75
75
|
**Min Time:** 0.0 µs
|
|
76
|
-
**Max Time:**
|
|
76
|
+
**Max Time:** 558.5 µs
|
|
77
77
|
**Threshold:** 5000 µs
|
|
78
78
|
**Status:** ✅ PASS
|
|
79
79
|
|
|
@@ -83,7 +83,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
83
83
|
**Iterations:** 20000
|
|
84
84
|
**Average Time:** 0.1 µs
|
|
85
85
|
**Min Time:** 0.0 µs
|
|
86
|
-
**Max Time:**
|
|
86
|
+
**Max Time:** 321.1 µs
|
|
87
87
|
**Threshold:** 5000 µs
|
|
88
88
|
**Status:** ✅ PASS
|
|
89
89
|
|
|
@@ -93,7 +93,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
93
93
|
**Iterations:** 20000
|
|
94
94
|
**Average Time:** 1.0 µs
|
|
95
95
|
**Min Time:** 0.2 µs
|
|
96
|
-
**Max Time:**
|
|
96
|
+
**Max Time:** 3170.4 µs
|
|
97
97
|
**Threshold:** 10000 µs
|
|
98
98
|
**Status:** ✅ PASS
|
|
99
99
|
|
|
@@ -101,9 +101,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
101
101
|
|
|
102
102
|
**Description:** Time to register an instance in registry
|
|
103
103
|
**Iterations:** 20000
|
|
104
|
-
**Average Time:** 6.
|
|
105
|
-
**Min Time:** 0.
|
|
106
|
-
**Max Time:**
|
|
104
|
+
**Average Time:** 6.9 µs
|
|
105
|
+
**Min Time:** 0.8 µs
|
|
106
|
+
**Max Time:** 40163.7 µs
|
|
107
107
|
**Threshold:** 5000 µs
|
|
108
108
|
**Status:** ✅ PASS
|
|
109
109
|
|
|
@@ -111,9 +111,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
111
111
|
|
|
112
112
|
**Description:** Time to lookup an existing instance from registry
|
|
113
113
|
**Iterations:** 20000
|
|
114
|
-
**Average Time:** 0.
|
|
115
|
-
**Min Time:** 0.
|
|
116
|
-
**Max Time:**
|
|
114
|
+
**Average Time:** 0.5 µs
|
|
115
|
+
**Min Time:** 0.1 µs
|
|
116
|
+
**Max Time:** 2411.6 µs
|
|
117
117
|
**Threshold:** 2000 µs
|
|
118
118
|
**Status:** ✅ PASS
|
|
119
119
|
|
|
@@ -123,7 +123,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
123
123
|
**Iterations:** 10000
|
|
124
124
|
**Average Time:** 6.4 µs
|
|
125
125
|
**Min Time:** 2.1 µs
|
|
126
|
-
**Max Time:**
|
|
126
|
+
**Max Time:** 8119.5 µs
|
|
127
127
|
**Threshold:** 25000 µs
|
|
128
128
|
**Status:** ✅ PASS
|
|
129
129
|
|
|
@@ -134,9 +134,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
134
134
|
**Description:** Time to register instance with 10 existing items in tree
|
|
135
135
|
**Tree Size:** 10 items
|
|
136
136
|
**Iterations:** 10000
|
|
137
|
-
**Average Time:** 2.
|
|
138
|
-
**Min Time:** 0.
|
|
139
|
-
**Max Time:**
|
|
137
|
+
**Average Time:** 2.5 µs
|
|
138
|
+
**Min Time:** 0.9 µs
|
|
139
|
+
**Max Time:** 8034.8 µs
|
|
140
140
|
**Threshold:** 5000 µs
|
|
141
141
|
**Status:** ✅ PASS
|
|
142
142
|
|
|
@@ -147,7 +147,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
147
147
|
**Iterations:** 20000
|
|
148
148
|
**Average Time:** 0.2 µs
|
|
149
149
|
**Min Time:** 0.0 µs
|
|
150
|
-
**Max Time:**
|
|
150
|
+
**Max Time:** 87.8 µs
|
|
151
151
|
**Threshold:** 2000 µs
|
|
152
152
|
**Status:** ✅ PASS
|
|
153
153
|
|
|
@@ -156,9 +156,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
156
156
|
**Description:** Time to register instance with 20 existing items in tree
|
|
157
157
|
**Tree Size:** 20 items
|
|
158
158
|
**Iterations:** 10000
|
|
159
|
-
**Average Time:**
|
|
159
|
+
**Average Time:** 2.1 µs
|
|
160
160
|
**Min Time:** 0.8 µs
|
|
161
|
-
**Max Time:**
|
|
161
|
+
**Max Time:** 6723.3 µs
|
|
162
162
|
**Threshold:** 5000 µs
|
|
163
163
|
**Status:** ✅ PASS
|
|
164
164
|
|
|
@@ -167,9 +167,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
167
167
|
**Description:** Time to lookup instance with 20 items in tree
|
|
168
168
|
**Tree Size:** 20 items
|
|
169
169
|
**Iterations:** 20000
|
|
170
|
-
**Average Time:** 0.
|
|
170
|
+
**Average Time:** 0.1 µs
|
|
171
171
|
**Min Time:** 0.0 µs
|
|
172
|
-
**Max Time:**
|
|
172
|
+
**Max Time:** 31.5 µs
|
|
173
173
|
**Threshold:** 2000 µs
|
|
174
174
|
**Status:** ✅ PASS
|
|
175
175
|
|
|
@@ -178,9 +178,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
178
178
|
**Description:** Time to register instance with 50 existing items in tree
|
|
179
179
|
**Tree Size:** 50 items
|
|
180
180
|
**Iterations:** 10000
|
|
181
|
-
**Average Time:**
|
|
182
|
-
**Min Time:** 0.
|
|
183
|
-
**Max Time:**
|
|
181
|
+
**Average Time:** 2.4 µs
|
|
182
|
+
**Min Time:** 0.8 µs
|
|
183
|
+
**Max Time:** 3273.2 µs
|
|
184
184
|
**Threshold:** 5000 µs
|
|
185
185
|
**Status:** ✅ PASS
|
|
186
186
|
|
|
@@ -189,9 +189,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
189
189
|
**Description:** Time to lookup instance with 50 items in tree
|
|
190
190
|
**Tree Size:** 50 items
|
|
191
191
|
**Iterations:** 20000
|
|
192
|
-
**Average Time:** 0.
|
|
192
|
+
**Average Time:** 0.1 µs
|
|
193
193
|
**Min Time:** 0.0 µs
|
|
194
|
-
**Max Time:**
|
|
194
|
+
**Max Time:** 446.4 µs
|
|
195
195
|
**Threshold:** 2000 µs
|
|
196
196
|
**Status:** ✅ PASS
|
|
197
197
|
|
|
@@ -200,9 +200,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
200
200
|
**Description:** Time to register instance with 100 existing items in tree
|
|
201
201
|
**Tree Size:** 100 items
|
|
202
202
|
**Iterations:** 10000
|
|
203
|
-
**Average Time:**
|
|
203
|
+
**Average Time:** 2.0 µs
|
|
204
204
|
**Min Time:** 0.8 µs
|
|
205
|
-
**Max Time:**
|
|
205
|
+
**Max Time:** 3239.7 µs
|
|
206
206
|
**Threshold:** 5000 µs
|
|
207
207
|
**Status:** ✅ PASS
|
|
208
208
|
|
|
@@ -211,9 +211,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
211
211
|
**Description:** Time to lookup instance with 100 items in tree
|
|
212
212
|
**Tree Size:** 100 items
|
|
213
213
|
**Iterations:** 20000
|
|
214
|
-
**Average Time:** 0.
|
|
214
|
+
**Average Time:** 0.1 µs
|
|
215
215
|
**Min Time:** 0.0 µs
|
|
216
|
-
**Max Time:**
|
|
216
|
+
**Max Time:** 36.8 µs
|
|
217
217
|
**Threshold:** 2000 µs
|
|
218
218
|
**Status:** ✅ PASS
|
|
219
219
|
|
|
@@ -222,9 +222,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
222
222
|
**Description:** Time to register instance with 200 existing items in tree
|
|
223
223
|
**Tree Size:** 200 items
|
|
224
224
|
**Iterations:** 10000
|
|
225
|
-
**Average Time:** 1.
|
|
225
|
+
**Average Time:** 1.9 µs
|
|
226
226
|
**Min Time:** 0.8 µs
|
|
227
|
-
**Max Time:**
|
|
227
|
+
**Max Time:** 3083.9 µs
|
|
228
228
|
**Threshold:** 10000 µs
|
|
229
229
|
**Status:** ✅ PASS
|
|
230
230
|
|
|
@@ -233,9 +233,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
233
233
|
**Description:** Time to lookup instance with 200 items in tree
|
|
234
234
|
**Tree Size:** 200 items
|
|
235
235
|
**Iterations:** 20000
|
|
236
|
-
**Average Time:** 0.
|
|
236
|
+
**Average Time:** 0.1 µs
|
|
237
237
|
**Min Time:** 0.0 µs
|
|
238
|
-
**Max Time:**
|
|
238
|
+
**Max Time:** 12.0 µs
|
|
239
239
|
**Threshold:** 5000 µs
|
|
240
240
|
**Status:** ✅ PASS
|
|
241
241
|
|
|
@@ -244,9 +244,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
244
244
|
**Description:** Time to register instance with 500 existing items in tree
|
|
245
245
|
**Tree Size:** 500 items
|
|
246
246
|
**Iterations:** 10000
|
|
247
|
-
**Average Time:** 1.
|
|
248
|
-
**Min Time:** 0.
|
|
249
|
-
**Max Time:**
|
|
247
|
+
**Average Time:** 1.8 µs
|
|
248
|
+
**Min Time:** 0.8 µs
|
|
249
|
+
**Max Time:** 1154.4 µs
|
|
250
250
|
**Threshold:** 10000 µs
|
|
251
251
|
**Status:** ✅ PASS
|
|
252
252
|
|
|
@@ -255,9 +255,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
255
255
|
**Description:** Time to lookup instance with 500 items in tree
|
|
256
256
|
**Tree Size:** 500 items
|
|
257
257
|
**Iterations:** 20000
|
|
258
|
-
**Average Time:** 0.
|
|
258
|
+
**Average Time:** 0.5 µs
|
|
259
259
|
**Min Time:** 0.0 µs
|
|
260
|
-
**Max Time:**
|
|
260
|
+
**Max Time:** 6698.5 µs
|
|
261
261
|
**Threshold:** 5000 µs
|
|
262
262
|
**Status:** ✅ PASS
|
|
263
263
|
|
|
@@ -266,9 +266,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
266
266
|
**Description:** Time to register instance with 1000 existing items in tree
|
|
267
267
|
**Tree Size:** 1000 items
|
|
268
268
|
**Iterations:** 10000
|
|
269
|
-
**Average Time:**
|
|
270
|
-
**Min Time:** 0.
|
|
271
|
-
**Max Time:**
|
|
269
|
+
**Average Time:** 3.3 µs
|
|
270
|
+
**Min Time:** 0.8 µs
|
|
271
|
+
**Max Time:** 7510.2 µs
|
|
272
272
|
**Threshold:** 10000 µs
|
|
273
273
|
**Status:** ✅ PASS
|
|
274
274
|
|
|
@@ -279,7 +279,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
279
279
|
**Iterations:** 20000
|
|
280
280
|
**Average Time:** 0.2 µs
|
|
281
281
|
**Min Time:** 0.0 µs
|
|
282
|
-
**Max Time:**
|
|
282
|
+
**Max Time:** 138.5 µs
|
|
283
283
|
**Threshold:** 5000 µs
|
|
284
284
|
**Status:** ✅ PASS
|
|
285
285
|
|
|
@@ -288,9 +288,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
288
288
|
**Description:** Time to register instance with 2000 existing items in tree
|
|
289
289
|
**Tree Size:** 2000 items
|
|
290
290
|
**Iterations:** 2500
|
|
291
|
-
**Average Time:**
|
|
292
|
-
**Min Time:**
|
|
293
|
-
**Max Time:**
|
|
291
|
+
**Average Time:** 3.1 µs
|
|
292
|
+
**Min Time:** 1.1 µs
|
|
293
|
+
**Max Time:** 370.3 µs
|
|
294
294
|
**Threshold:** 20000 µs
|
|
295
295
|
**Status:** ✅ PASS
|
|
296
296
|
|
|
@@ -300,8 +300,8 @@ consistent performance, while wider bands show more variability.*
|
|
|
300
300
|
**Tree Size:** 2000 items
|
|
301
301
|
**Iterations:** 5000
|
|
302
302
|
**Average Time:** 0.2 µs
|
|
303
|
-
**Min Time:** 0.
|
|
304
|
-
**Max Time:** 8.
|
|
303
|
+
**Min Time:** 0.1 µs
|
|
304
|
+
**Max Time:** 8.5 µs
|
|
305
305
|
**Threshold:** 10000 µs
|
|
306
306
|
**Status:** ✅ PASS
|
|
307
307
|
|
|
@@ -310,9 +310,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
310
310
|
**Description:** Time to register instance with 5000 existing items in tree
|
|
311
311
|
**Tree Size:** 5000 items
|
|
312
312
|
**Iterations:** 2500
|
|
313
|
-
**Average Time:** 1
|
|
313
|
+
**Average Time:** 2.1 µs
|
|
314
314
|
**Min Time:** 1.1 µs
|
|
315
|
-
**Max Time:**
|
|
315
|
+
**Max Time:** 379.8 µs
|
|
316
316
|
**Threshold:** 20000 µs
|
|
317
317
|
**Status:** ✅ PASS
|
|
318
318
|
|
|
@@ -321,9 +321,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
321
321
|
**Description:** Time to lookup instance with 5000 items in tree
|
|
322
322
|
**Tree Size:** 5000 items
|
|
323
323
|
**Iterations:** 5000
|
|
324
|
-
**Average Time:**
|
|
325
|
-
**Min Time:** 0.
|
|
326
|
-
**Max Time:**
|
|
324
|
+
**Average Time:** 0.2 µs
|
|
325
|
+
**Min Time:** 0.1 µs
|
|
326
|
+
**Max Time:** 4.3 µs
|
|
327
327
|
**Threshold:** 10000 µs
|
|
328
328
|
**Status:** ✅ PASS
|
|
329
329
|
|
|
@@ -332,9 +332,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
332
332
|
**Description:** Time to register instance with 10000 existing items in tree
|
|
333
333
|
**Tree Size:** 10000 items
|
|
334
334
|
**Iterations:** 2500
|
|
335
|
-
**Average Time:**
|
|
336
|
-
**Min Time:**
|
|
337
|
-
**Max Time:**
|
|
335
|
+
**Average Time:** 2.3 µs
|
|
336
|
+
**Min Time:** 0.9 µs
|
|
337
|
+
**Max Time:** 1541.2 µs
|
|
338
338
|
**Threshold:** 20000 µs
|
|
339
339
|
**Status:** ✅ PASS
|
|
340
340
|
|
|
@@ -343,9 +343,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
343
343
|
**Description:** Time to lookup instance with 10000 items in tree
|
|
344
344
|
**Tree Size:** 10000 items
|
|
345
345
|
**Iterations:** 5000
|
|
346
|
-
**Average Time:** 0.
|
|
347
|
-
**Min Time:** 0.
|
|
348
|
-
**Max Time:**
|
|
346
|
+
**Average Time:** 0.4 µs
|
|
347
|
+
**Min Time:** 0.1 µs
|
|
348
|
+
**Max Time:** 35.2 µs
|
|
349
349
|
**Threshold:** 10000 µs
|
|
350
350
|
**Status:** ✅ PASS
|
|
351
351
|
|
|
@@ -356,7 +356,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
356
356
|
**Iterations:** 500
|
|
357
357
|
**Average Time:** 1.2 µs
|
|
358
358
|
**Min Time:** 0.9 µs
|
|
359
|
-
**Max Time:**
|
|
359
|
+
**Max Time:** 22.7 µs
|
|
360
360
|
**Threshold:** 50000 µs
|
|
361
361
|
**Status:** ✅ PASS
|
|
362
362
|
|
|
@@ -366,8 +366,8 @@ consistent performance, while wider bands show more variability.*
|
|
|
366
366
|
**Tree Size:** 20000 items
|
|
367
367
|
**Iterations:** 1250
|
|
368
368
|
**Average Time:** 0.3 µs
|
|
369
|
-
**Min Time:** 0.
|
|
370
|
-
**Max Time:**
|
|
369
|
+
**Min Time:** 0.0 µs
|
|
370
|
+
**Max Time:** 29.1 µs
|
|
371
371
|
**Threshold:** 25000 µs
|
|
372
372
|
**Status:** ✅ PASS
|
|
373
373
|
|
|
@@ -376,9 +376,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
376
376
|
**Description:** Time to register instance with 50000 existing items in tree
|
|
377
377
|
**Tree Size:** 50000 items
|
|
378
378
|
**Iterations:** 500
|
|
379
|
-
**Average Time:** 1.
|
|
379
|
+
**Average Time:** 1.4 µs
|
|
380
380
|
**Min Time:** 0.9 µs
|
|
381
|
-
**Max Time:**
|
|
381
|
+
**Max Time:** 37.1 µs
|
|
382
382
|
**Threshold:** 50000 µs
|
|
383
383
|
**Status:** ✅ PASS
|
|
384
384
|
|
|
@@ -389,7 +389,7 @@ consistent performance, while wider bands show more variability.*
|
|
|
389
389
|
**Iterations:** 1250
|
|
390
390
|
**Average Time:** 0.2 µs
|
|
391
391
|
**Min Time:** 0.1 µs
|
|
392
|
-
**Max Time:** 3
|
|
392
|
+
**Max Time:** 2.3 µs
|
|
393
393
|
**Threshold:** 25000 µs
|
|
394
394
|
**Status:** ✅ PASS
|
|
395
395
|
|
|
@@ -398,9 +398,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
398
398
|
**Description:** Time to register instance with 100000 existing items in tree
|
|
399
399
|
**Tree Size:** 100000 items
|
|
400
400
|
**Iterations:** 500
|
|
401
|
-
**Average Time:** 1.
|
|
402
|
-
**Min Time:** 0
|
|
403
|
-
**Max Time:**
|
|
401
|
+
**Average Time:** 1.5 µs
|
|
402
|
+
**Min Time:** 1.0 µs
|
|
403
|
+
**Max Time:** 44.6 µs
|
|
404
404
|
**Threshold:** 50000 µs
|
|
405
405
|
**Status:** ✅ PASS
|
|
406
406
|
|
|
@@ -409,9 +409,9 @@ consistent performance, while wider bands show more variability.*
|
|
|
409
409
|
**Description:** Time to lookup instance with 100000 items in tree
|
|
410
410
|
**Tree Size:** 100000 items
|
|
411
411
|
**Iterations:** 1250
|
|
412
|
-
**Average Time:** 0.
|
|
412
|
+
**Average Time:** 0.3 µs
|
|
413
413
|
**Min Time:** 0.1 µs
|
|
414
|
-
**Max Time:**
|
|
414
|
+
**Max Time:** 2.4 µs
|
|
415
415
|
**Threshold:** 25000 µs
|
|
416
416
|
**Status:** ✅ PASS
|
|
417
417
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [react()],
|
|
6
|
+
test: {
|
|
7
|
+
globals: true,
|
|
8
|
+
environment: 'jsdom',
|
|
9
|
+
setupFiles: ['./src/test/setup.ts'],
|
|
10
|
+
coverage: {
|
|
11
|
+
reporter: ['text', 'json', 'html']
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
})
|
package/examples/README.md
CHANGED
|
@@ -115,6 +115,35 @@ const email = hub.get('communication', ['email'], { scopes: ['prod'] });
|
|
|
115
115
|
- **Microservices**: Each key path represents a different service
|
|
116
116
|
- **Multi-Region**: Different implementations across regions
|
|
117
117
|
|
|
118
|
+
## Using the Registry
|
|
119
|
+
|
|
120
|
+
The registry provides a centralized way to manage instances in your application. Here are the main operations you can perform:
|
|
121
|
+
|
|
122
|
+
### Getting All Coordinates
|
|
123
|
+
|
|
124
|
+
You can retrieve a list of all coordinates currently registered in the registry:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { createRegistry } from '@fjell/registry';
|
|
128
|
+
|
|
129
|
+
const registry = createRegistry('myRegistry');
|
|
130
|
+
|
|
131
|
+
// Register some instances...
|
|
132
|
+
registry.createInstance(['service'], ['production'], factory1);
|
|
133
|
+
registry.createInstance(['cache', 'redis'], ['development'], factory2);
|
|
134
|
+
|
|
135
|
+
// Get all coordinates
|
|
136
|
+
const coordinates = registry.getCoordinates();
|
|
137
|
+
console.log(`Found ${coordinates.length} registered coordinates:`);
|
|
138
|
+
coordinates.forEach(coord => {
|
|
139
|
+
console.log(`- ${coord.toString()}`);
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This is useful for debugging, monitoring, or implementing discovery mechanisms in your application.
|
|
144
|
+
|
|
145
|
+
### Basic Instance Management
|
|
146
|
+
|
|
118
147
|
## Running Examples
|
|
119
148
|
|
|
120
149
|
```bash
|
|
@@ -127,6 +156,12 @@ npx tsx examples/multi-level-keys.ts
|
|
|
127
156
|
# Run the RegistryHub with service types example
|
|
128
157
|
npx tsx examples/registry-hub-types.ts
|
|
129
158
|
|
|
159
|
+
# Run the coordinate discovery and introspection example
|
|
160
|
+
npx tsx examples/coordinates-example.ts
|
|
161
|
+
|
|
162
|
+
# Run the RegistryHub cross-registry coordinate discovery example
|
|
163
|
+
npx tsx examples/registry-hub-coordinates-example.ts
|
|
164
|
+
|
|
130
165
|
# Or in Node.js
|
|
131
166
|
node -r esbuild-register examples/simple-example.ts
|
|
132
167
|
node -r esbuild-register examples/registry-hub-types.ts
|