@smartnet360/svelte-components 0.0.123 → 0.0.124
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/dist/apps/antenna-tools/components/AntennaControls.svelte +71 -9
- package/dist/apps/antenna-tools/components/AntennaControls.svelte.d.ts +2 -0
- package/dist/apps/antenna-tools/components/AntennaTools.svelte +48 -82
- package/dist/apps/antenna-tools/components/DatabaseViewer.svelte +3 -6
- package/dist/apps/antenna-tools/components/MSIConverter.svelte +75 -9
- package/dist/apps/antenna-tools/utils/msi-parser.d.ts +35 -1
- package/dist/apps/antenna-tools/utils/msi-parser.js +105 -35
- package/dist/core/Benchmark/Benchmark.svelte +662 -0
- package/dist/core/Benchmark/Benchmark.svelte.d.ts +3 -0
- package/dist/core/Benchmark/benchmark-utils.d.ts +48 -0
- package/dist/core/Benchmark/benchmark-utils.js +80 -0
- package/dist/core/Benchmark/index.d.ts +2 -0
- package/dist/core/Benchmark/index.js +3 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Benchmark utilities for measuring Svelte reactivity performance
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Generate test data array
|
|
6
|
+
*/
|
|
7
|
+
export function generateTestData(count) {
|
|
8
|
+
const categories = ['A', 'B', 'C', 'D', 'E'];
|
|
9
|
+
const items = [];
|
|
10
|
+
for (let i = 0; i < count; i++) {
|
|
11
|
+
items.push({
|
|
12
|
+
id: i,
|
|
13
|
+
name: `Item ${i}`,
|
|
14
|
+
value: Math.random() * 1000,
|
|
15
|
+
category: categories[i % categories.length],
|
|
16
|
+
active: i % 2 === 0,
|
|
17
|
+
data: Array.from({ length: 10 }, () => Math.random() * 100)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return items;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Measure execution time of a function
|
|
24
|
+
*/
|
|
25
|
+
export function measure(fn) {
|
|
26
|
+
const start = performance.now();
|
|
27
|
+
const result = fn();
|
|
28
|
+
const duration = performance.now() - start;
|
|
29
|
+
return { result, duration };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Measure async execution time
|
|
33
|
+
*/
|
|
34
|
+
export async function measureAsync(fn) {
|
|
35
|
+
const start = performance.now();
|
|
36
|
+
const result = await fn();
|
|
37
|
+
const duration = performance.now() - start;
|
|
38
|
+
return { result, duration };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Format duration for display
|
|
42
|
+
*/
|
|
43
|
+
export function formatDuration(ms) {
|
|
44
|
+
if (ms < 1) {
|
|
45
|
+
return `${(ms * 1000).toFixed(2)} µs`;
|
|
46
|
+
}
|
|
47
|
+
else if (ms < 1000) {
|
|
48
|
+
return `${ms.toFixed(2)} ms`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return `${(ms / 1000).toFixed(2)} s`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a detailed log entry
|
|
56
|
+
*/
|
|
57
|
+
export function logBenchmark(result) {
|
|
58
|
+
const opsFormatted = result.opsPerSecond > 1000
|
|
59
|
+
? `${(result.opsPerSecond / 1000).toFixed(2)}K ops/s`
|
|
60
|
+
: `${result.opsPerSecond.toFixed(2)} ops/s`;
|
|
61
|
+
console.log(`%c[BENCHMARK] ${result.name}%c\n` +
|
|
62
|
+
` Duration: ${formatDuration(result.duration)}\n` +
|
|
63
|
+
` Items: ${result.itemCount.toLocaleString()}\n` +
|
|
64
|
+
` Performance: ${opsFormatted}`, 'color: #4CAF50; font-weight: bold;', 'color: inherit;');
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Run a benchmark and return result
|
|
68
|
+
*/
|
|
69
|
+
export function runBenchmark(name, fn, itemCount) {
|
|
70
|
+
const { duration } = measure(fn);
|
|
71
|
+
const result = {
|
|
72
|
+
name,
|
|
73
|
+
duration,
|
|
74
|
+
itemCount,
|
|
75
|
+
opsPerSecond: (itemCount / duration) * 1000,
|
|
76
|
+
timestamp: new Date()
|
|
77
|
+
};
|
|
78
|
+
logBenchmark(result);
|
|
79
|
+
return result;
|
|
80
|
+
}
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -17,3 +17,5 @@ export * from './CellTable/index.js';
|
|
|
17
17
|
// export * from './Map/index.js';
|
|
18
18
|
// FeatureRegistry - Component access management
|
|
19
19
|
export * from './FeatureRegistry/index.js';
|
|
20
|
+
// Benchmark - Performance testing for Svelte reactivity
|
|
21
|
+
export * from './Benchmark/index.js';
|