oneie 1.3.3 ā 1.4.0
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/.claude/agents/engineering-architect.md +39 -56
- package/.claude/agents/engineering-developer.md +37 -57
- package/.claude/agents/engineering-director.md +37 -144
- package/.claude/agents/engineering-ingestor.md +229 -0
- package/.claude/agents/engineering-quality-assurance.md +40 -206
- package/.claude/agents/engineering-user-experience.md +36 -207
- package/.claude/agents/improver.md +454 -0
- package/.claude/agents/marketing-brand-identity.md +37 -48
- package/.claude/agents/marketing-director.md +9 -0
- package/.claude/agents/one-orchestrator.md +50 -136
- package/.claude/agents/story-teller.md +10 -0
- package/.claude/agents/task-master.md +10 -0
- package/.claude/agents/turbo-repo-builder.md +51 -0
- package/.claude/claude-code-hooks.json +20 -233
- package/.claude/commands/agent-balance +111 -0
- package/.claude/commands/agent.md +24 -7
- package/.claude/commands/cascade-status.md +128 -0
- package/.claude/commands/ingest.md +290 -0
- package/.claude/commands/ingestor.md +136 -0
- package/.claude/commands/mission.md +26 -8
- package/.claude/commands/one.md +351 -14
- package/.claude/commands/quality-check.md +204 -0
- package/.claude/commands/smart-route.md +220 -0
- package/.claude/commands/start.md +9 -8
- package/.claude/commands/story.md +18 -3
- package/.claude/commands/task.md +22 -1
- package/.claude/settings.local.json +18 -3
- package/.obsidian/core-plugins.json +3 -1
- package/.one/checklists/agent-quality-checklist.md +24 -15
- package/.one/checklists/story-quality-checklist.md +24 -15
- package/.one/checklists/task-quality-checklist.md +24 -15
- package/.one/templates/bun-workspace-guide-template.md +188 -0
- package/.one/templates/bunfig-template.toml +95 -0
- package/.one/templates/root-package-template.json +37 -21
- package/.one/templates/turbo-config-template.json +18 -3
- package/.one/tools/bump-core-version.js +0 -0
- package/.one/tools/bump-expansion-version.js +0 -0
- package/.one/tools/code-generators.js +0 -0
- package/.one/tools/compression-engine.js +638 -0
- package/.one/tools/content-deduplicator.js +336 -0
- package/.one/tools/convert-wav-to-mp3.js +0 -0
- package/.one/tools/foundation-wizard.js +0 -0
- package/.one/tools/generate-toc.js +0 -0
- package/.one/tools/ingestor/cascade-integration.js +523 -0
- package/.one/tools/ingestor/cli.ts +234 -0
- package/.one/tools/ingestor/context-mapper.ts +604 -0
- package/.one/tools/ingestor/error-handling-monitor.js +742 -0
- package/.one/tools/ingestor/file-discovery.ts +484 -0
- package/.one/tools/ingestor/file-transformer.ts +524 -0
- package/.one/tools/ingestor/ingestor-orchestrator.ts +416 -0
- package/.one/tools/ingestor/package.json +47 -0
- package/.one/tools/ingestor/usage-examples.md +458 -0
- package/.one/tools/lazy-loader.js +489 -0
- package/.one/tools/minimal-generators.js +0 -0
- package/.one/tools/performance-benchmark.js +300 -0
- package/.one/tools/premium-manager.js +0 -0
- package/.one/tools/semantic-release-sync-installer.js +0 -0
- package/.one/tools/size-memory-optimizer.js +475 -0
- package/.one/tools/sync-installer-version.js +0 -0
- package/.one/tools/text-to-speech.js +0 -0
- package/.one/tools/transformative-ai-engine.js +0 -0
- package/.one/workflows/safe-improvement-deployment.yaml +420 -0
- package/CLAUDE.md +30 -0
- package/README.md +41 -10
- package/bin/oneie/index.js +733 -64
- package/one/cache/benchmark-results.json +43 -0
- package/one/cache/file-index.json +12480 -0
- package/one/config/agent-routing.yaml +124 -0
- package/one/config/agent-skills.yaml +451 -0
- package/one/config/cache-config.yaml +304 -0
- package/one/config/feedback-templates.yaml +152 -0
- package/one/config/performance-config.yaml +281 -0
- package/one/config/quality-automation.yaml +405 -0
- package/one/config/routing-logic.yaml +292 -0
- package/one/data/task-registry.yaml +224 -0
- package/one/stories/story-1.10-parallel-task-execution-orchestration.md +119 -0
- package/one/stories/story-3.1-external-repository-foundation.md +374 -0
- package/one/stories/story-3.2-3-levels-architecture-integration.md +449 -0
- package/one/stories/story-3.3-multi-platform-application-development.md +677 -0
- package/one/stories/story-3.4-shared-package-system-ui-components.md +854 -0
- package/one/stories/story-3.5-backend-integration-production-deployment.md +1034 -0
- package/one/tasks/task-1.10.1-design-parallel-execution-architecture.md +108 -0
- package/one/tasks/task-1.10.2-create-task-dependency-mapping-system.md +82 -0
- package/one/tasks/task-1.10.3-build-agent-spawning-orchestration-engine.md +120 -0
- package/one/tasks/task-1.10.4-implement-task-queue-dependency-resolution.md +125 -0
- package/one/tasks/task-1.10.5-create-task-numbering-convention-system.md +542 -0
- package/one/tasks/task-3.1.1-external-repository-creation.md +303 -0
- package/one/tasks/task-3.1.2-turborepo-configuration-optimization.md +402 -0
- package/one/tasks/task-3.1.3-shared-configuration-packages.md +571 -0
- package/one/tasks/task-3.1.4-bun-package-management-optimization.md +627 -0
- package/one/tools/task-numbering-validator.js +429 -0
- package/package.json +1 -1
- package/quality-gate-optimization-analysis.md +260 -0
- package/turbo-benchmark.js +268 -0
- package/turbo-optimization-guide.md +163 -0
- package/turbo-workspace-template.json +83 -0
- package/turbo.json +178 -0
- package/.claude/commands/analyst.md +0 -70
- package/.claude/commands/architect.md +0 -67
- package/.claude/commands/commander.md +0 -78
- package/.claude/commands/deploy.md +0 -68
- package/.claude/commands/dev.md +0 -60
- package/.claude/commands/playbook.md +0 -81
- package/.claude/commands/pm.md +0 -64
- package/.claude/commands/po.md +0 -68
- package/.claude/commands/qa.md +0 -59
- package/.claude/commands/taskmaster.md +0 -85
- package/.claude/commands/ux-expert.md +0 -58
- package/.one/stories/bullstamp-attract-module-complete.md +0 -255
- package/.one/stories/bullstamp-deployment-master-plan.md +0 -518
- package/.one/stories/bullstamp-executive-implementation-summary.md +0 -254
- package/.one/stories/bullstamp-project-status-complete.md +0 -257
- package/.one/stories/obsidian-pandoc-config.md +0 -159
- package/.one/stories/story-1.1-perfect-filesystem-organization.md +0 -270
- package/.one/stories/story-1.1.1.md +0 -136
- package/.one/stories/story-1.1.md +0 -131
- package/.one/stories/story-1.2.md +0 -420
- package/.one/stories/story-1.3.md +0 -177
- package/.one/stories/story-1.4.md +0 -356
- package/.one/stories/story-1.5.md +0 -572
- package/.one/stories/story-1.6.md +0 -481
- package/.one/stories/story-1.7.md +0 -923
- package/.one/stories/story-1.8.md +0 -404
- package/.one/stories/story-2.0.md +0 -132
- package/.one/stories/story-2.1.md +0 -110
- package/.one/stories/story-2.2.md +0 -110
- package/.one/stories/story-2.3.md +0 -112
- package/.one/stories/story-2.4.md +0 -116
- package/.one/stories/story-2.5.md +0 -114
- package/.one/stories/story-3.1.md +0 -298
- package/.one/stories/story-3.10.md +0 -302
- package/.one/stories/story-3.11.md +0 -167
- package/.one/stories/story-3.12.md +0 -235
- package/.one/stories/story-3.13.md +0 -235
- package/.one/stories/story-3.14.md +0 -225
- package/.one/stories/story-3.15.md +0 -238
- package/.one/stories/story-3.16.md +0 -244
- package/.one/stories/story-3.17.md +0 -245
- package/.one/stories/story-3.18.md +0 -248
- package/.one/stories/story-3.2.md +0 -226
- package/.one/stories/story-3.3.md +0 -226
- package/.one/stories/story-3.4.md +0 -226
- package/.one/stories/story-3.5.md +0 -167
- package/.one/stories/story-3.6.md +0 -167
- package/.one/stories/story-3.7.md +0 -181
- package/.one/stories/story-3.8.md +0 -198
- package/.one/stories/story-3.9.md +0 -169
- package/.one/stories/story-4.1.md +0 -245
- package/.one/stories/story-4.2.md +0 -314
- package/.one/stories/story-4.3.md +0 -610
- package/.one/stories/story-4.4.md +0 -931
- package/.one/stories/story-4.5.md +0 -727
- package/.one/stories/story-4.6-consistency.md +0 -175
- package/.one/stories/story-5.1.md +0 -508
- package/.one/stories/story-5.2.md +0 -451
- package/.one/stories/story-5.3.md +0 -405
- package/.one/stories/story-5.4.md +0 -447
- package/.one/stories/story-5.5.md +0 -349
- package/.one/stories/story-5.6.md +0 -445
- package/.one/stories/story-6.1-text-content-engine.md +0 -144
- package/.one/stories/story-6.2-audio-content-engine.md +0 -145
- package/.one/stories/story-6.3-video-content-engine.md +0 -145
- package/.one/stories/story-6.4-visual-content-engine.md +0 -177
- package/.one/stories/story-6.5-cross-platform-distribution.md +0 -188
- package/.one/stories/story-6.6.ai-content-generation-pipeline.md +0 -196
- package/.one/stories/story-6.7-character-consistency-quality-control.md +0 -216
- package/.one/stories/story-6.8-claude-code-content-integration.md +0 -181
- package/.one/stories/story-6.8-content-production-workflows.md +0 -247
- package/.one/stories/story-7.1-implementation.md +0 -128
- package/.one/stories/story-7.1.md +0 -203
- package/.one/stories/story-7.2-implementation.md +0 -147
- package/.one/stories/story-7.2.md +0 -415
- package/.one/stories/story-7.3-implementation.md +0 -159
- package/.one/stories/story-7.3.md +0 -463
- package/.one/stories/story-7.4-implementation.md +0 -154
- package/.one/stories/story-7.4.md +0 -500
- package/.one/stories/story-validation-report.md +0 -169
- package/one/archive-index.json +0 -91
- /package/one/stories/{story-3.1-npx-oneie-turbo-enhancement.md ā story-2.1.1-npx-oneie-turbo-enhancement.md} +0 -0
- /package/one/stories/{story-3.2-npx-connection-implementation.md ā story-2.21-npx-connection-implementation.md} +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Performance Benchmark - ONE Framework
|
|
5
|
+
*
|
|
6
|
+
* Benchmarks startup time improvements from the lazy loading system
|
|
7
|
+
* Compares optimized vs traditional loading approaches
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { promises as fs } from 'fs';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
16
|
+
|
|
17
|
+
class PerformanceBenchmark {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.results = {
|
|
20
|
+
traditional: { times: [], average: 0, median: 0 },
|
|
21
|
+
optimized: { times: [], average: 0, median: 0 },
|
|
22
|
+
improvement: { absolute: 0, percentage: 0 }
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Run complete benchmark suite
|
|
28
|
+
*/
|
|
29
|
+
async runBenchmark(iterations = 5) {
|
|
30
|
+
console.log('š Starting Performance Benchmark...');
|
|
31
|
+
console.log(`š Running ${iterations} iterations for each approach\n`);
|
|
32
|
+
|
|
33
|
+
// Benchmark traditional loading
|
|
34
|
+
console.log('š Benchmarking traditional loading...');
|
|
35
|
+
for (let i = 0; i < iterations; i++) {
|
|
36
|
+
const time = await this.benchmarkTraditionalLoading();
|
|
37
|
+
this.results.traditional.times.push(time);
|
|
38
|
+
console.log(` Run ${i + 1}: ${time}ms`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Benchmark optimized loading
|
|
42
|
+
console.log('\nā” Benchmarking optimized loading...');
|
|
43
|
+
for (let i = 0; i < iterations; i++) {
|
|
44
|
+
const time = await this.benchmarkOptimizedLoading();
|
|
45
|
+
this.results.optimized.times.push(time);
|
|
46
|
+
console.log(` Run ${i + 1}: ${time}ms`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Calculate statistics
|
|
50
|
+
this.calculateStatistics();
|
|
51
|
+
|
|
52
|
+
// Display results
|
|
53
|
+
this.displayResults();
|
|
54
|
+
|
|
55
|
+
return this.results;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Benchmark traditional file loading approach
|
|
60
|
+
*/
|
|
61
|
+
async benchmarkTraditionalLoading() {
|
|
62
|
+
const startTime = Date.now();
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
// Simulate traditional approach: load all files at startup
|
|
66
|
+
const files = await this.getAllMarkdownFiles();
|
|
67
|
+
const loadPromises = files.slice(0, 100).map(async (file) => {
|
|
68
|
+
try {
|
|
69
|
+
return await fs.readFile(file, 'utf8');
|
|
70
|
+
} catch (error) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
await Promise.all(loadPromises);
|
|
76
|
+
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.warn('Traditional loading error:', error.message);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return Date.now() - startTime;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Benchmark optimized lazy loading approach
|
|
86
|
+
*/
|
|
87
|
+
async benchmarkOptimizedLoading() {
|
|
88
|
+
const startTime = Date.now();
|
|
89
|
+
|
|
90
|
+
try {
|
|
91
|
+
// Import and initialize the lazy loader
|
|
92
|
+
const { default: LazyLoader } = await import('./lazy-loader.js');
|
|
93
|
+
const loader = new LazyLoader();
|
|
94
|
+
|
|
95
|
+
// Just do the critical path and indexing (no background loading)
|
|
96
|
+
await loader.loadCriticalPath();
|
|
97
|
+
await loader.buildFileIndex();
|
|
98
|
+
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.warn('Optimized loading error:', error.message);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return Date.now() - startTime;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get all markdown files for traditional loading simulation
|
|
108
|
+
*/
|
|
109
|
+
async getAllMarkdownFiles() {
|
|
110
|
+
const files = [];
|
|
111
|
+
const directories = ['.claude', '.one', 'one'];
|
|
112
|
+
|
|
113
|
+
for (const dir of directories) {
|
|
114
|
+
try {
|
|
115
|
+
const dirFiles = await this.getFilesRecursive(dir);
|
|
116
|
+
files.push(...dirFiles.filter(f => f.endsWith('.md')));
|
|
117
|
+
} catch (error) {
|
|
118
|
+
// Skip directories we can't read
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return files;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Get files recursively from directory
|
|
127
|
+
*/
|
|
128
|
+
async getFilesRecursive(dirPath) {
|
|
129
|
+
const files = [];
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
const items = await fs.readdir(dirPath, { withFileTypes: true });
|
|
133
|
+
|
|
134
|
+
for (const item of items) {
|
|
135
|
+
const fullPath = path.join(dirPath, item.name);
|
|
136
|
+
|
|
137
|
+
if (item.isDirectory() && !item.name.startsWith('.git') && item.name !== 'node_modules') {
|
|
138
|
+
const subFiles = await this.getFilesRecursive(fullPath);
|
|
139
|
+
files.push(...subFiles);
|
|
140
|
+
} else if (item.isFile()) {
|
|
141
|
+
files.push(fullPath);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
} catch (error) {
|
|
145
|
+
// Directory not accessible
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return files;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Calculate benchmark statistics
|
|
153
|
+
*/
|
|
154
|
+
calculateStatistics() {
|
|
155
|
+
// Traditional stats
|
|
156
|
+
const tradTimes = this.results.traditional.times.sort((a, b) => a - b);
|
|
157
|
+
this.results.traditional.average = tradTimes.reduce((sum, time) => sum + time, 0) / tradTimes.length;
|
|
158
|
+
this.results.traditional.median = tradTimes[Math.floor(tradTimes.length / 2)];
|
|
159
|
+
this.results.traditional.min = tradTimes[0];
|
|
160
|
+
this.results.traditional.max = tradTimes[tradTimes.length - 1];
|
|
161
|
+
|
|
162
|
+
// Optimized stats
|
|
163
|
+
const optTimes = this.results.optimized.times.sort((a, b) => a - b);
|
|
164
|
+
this.results.optimized.average = optTimes.reduce((sum, time) => sum + time, 0) / optTimes.length;
|
|
165
|
+
this.results.optimized.median = optTimes[Math.floor(optTimes.length / 2)];
|
|
166
|
+
this.results.optimized.min = optTimes[0];
|
|
167
|
+
this.results.optimized.max = optTimes[optTimes.length - 1];
|
|
168
|
+
|
|
169
|
+
// Improvement calculations
|
|
170
|
+
this.results.improvement.absolute = this.results.traditional.average - this.results.optimized.average;
|
|
171
|
+
this.results.improvement.percentage = (this.results.improvement.absolute / this.results.traditional.average) * 100;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Display benchmark results
|
|
176
|
+
*/
|
|
177
|
+
displayResults() {
|
|
178
|
+
console.log('\n' + '='.repeat(60));
|
|
179
|
+
console.log('š PERFORMANCE BENCHMARK RESULTS');
|
|
180
|
+
console.log('='.repeat(60));
|
|
181
|
+
|
|
182
|
+
// Traditional results
|
|
183
|
+
console.log('\nš TRADITIONAL LOADING:');
|
|
184
|
+
console.log(` Average: ${Math.round(this.results.traditional.average)}ms`);
|
|
185
|
+
console.log(` Median: ${Math.round(this.results.traditional.median)}ms`);
|
|
186
|
+
console.log(` Range: ${Math.round(this.results.traditional.min)}ms - ${Math.round(this.results.traditional.max)}ms`);
|
|
187
|
+
|
|
188
|
+
// Optimized results
|
|
189
|
+
console.log('\nā” OPTIMIZED LOADING:');
|
|
190
|
+
console.log(` Average: ${Math.round(this.results.optimized.average)}ms`);
|
|
191
|
+
console.log(` Median: ${Math.round(this.results.optimized.median)}ms`);
|
|
192
|
+
console.log(` Range: ${Math.round(this.results.optimized.min)}ms - ${Math.round(this.results.optimized.max)}ms`);
|
|
193
|
+
|
|
194
|
+
// Improvement
|
|
195
|
+
console.log('\nš IMPROVEMENT:');
|
|
196
|
+
console.log(` Absolute: ${Math.round(this.results.improvement.absolute)}ms faster`);
|
|
197
|
+
console.log(` Relative: ${Math.round(this.results.improvement.percentage)}% faster`);
|
|
198
|
+
|
|
199
|
+
// Performance grade
|
|
200
|
+
const grade = this.getPerformanceGrade();
|
|
201
|
+
console.log(` Grade: ${grade.letter} (${grade.description})`);
|
|
202
|
+
|
|
203
|
+
// Conclusion
|
|
204
|
+
console.log('\n' + '='.repeat(60));
|
|
205
|
+
this.printConclusion();
|
|
206
|
+
console.log('='.repeat(60));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Get performance grade based on improvement
|
|
211
|
+
*/
|
|
212
|
+
getPerformanceGrade() {
|
|
213
|
+
const percentage = this.results.improvement.percentage;
|
|
214
|
+
|
|
215
|
+
if (percentage >= 80) return { letter: 'A+', description: 'Exceptional optimization' };
|
|
216
|
+
if (percentage >= 70) return { letter: 'A', description: 'Excellent optimization' };
|
|
217
|
+
if (percentage >= 60) return { letter: 'B+', description: 'Very good optimization' };
|
|
218
|
+
if (percentage >= 50) return { letter: 'B', description: 'Good optimization' };
|
|
219
|
+
if (percentage >= 40) return { letter: 'C+', description: 'Moderate optimization' };
|
|
220
|
+
if (percentage >= 30) return { letter: 'C', description: 'Some optimization' };
|
|
221
|
+
if (percentage >= 20) return { letter: 'D+', description: 'Minor optimization' };
|
|
222
|
+
if (percentage >= 10) return { letter: 'D', description: 'Minimal optimization' };
|
|
223
|
+
return { letter: 'F', description: 'No significant optimization' };
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Print benchmark conclusion
|
|
228
|
+
*/
|
|
229
|
+
printConclusion() {
|
|
230
|
+
const improvement = Math.round(this.results.improvement.percentage);
|
|
231
|
+
const avgOptimized = Math.round(this.results.optimized.average);
|
|
232
|
+
const target = 10000; // 10 seconds target
|
|
233
|
+
|
|
234
|
+
console.log('š CONCLUSION:');
|
|
235
|
+
|
|
236
|
+
if (avgOptimized < 3000) {
|
|
237
|
+
console.log(`ā
EXCELLENT: ${avgOptimized}ms is under 3 second critical path target`);
|
|
238
|
+
} else if (avgOptimized < 7000) {
|
|
239
|
+
console.log(`ā
GOOD: ${avgOptimized}ms is under 7 second indexing target`);
|
|
240
|
+
} else if (avgOptimized < target) {
|
|
241
|
+
console.log(`ā
ACCEPTABLE: ${avgOptimized}ms is under ${target/1000} second total target`);
|
|
242
|
+
} else {
|
|
243
|
+
console.log(`ā NEEDS WORK: ${avgOptimized}ms exceeds ${target/1000} second target`);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
console.log(`š The lazy loading system provides ${improvement}% performance improvement`);
|
|
247
|
+
|
|
248
|
+
if (improvement > 50) {
|
|
249
|
+
console.log(`š SUCCESS: Significant optimization achieved!`);
|
|
250
|
+
} else if (improvement > 25) {
|
|
251
|
+
console.log(`š GOOD: Meaningful optimization achieved!`);
|
|
252
|
+
} else {
|
|
253
|
+
console.log(`ā ļø REVIEW: Consider additional optimizations`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Save benchmark results to file
|
|
259
|
+
*/
|
|
260
|
+
async saveBenchmarkResults() {
|
|
261
|
+
try {
|
|
262
|
+
const reportPath = path.join(__dirname, '../../one/cache/benchmark-results.json');
|
|
263
|
+
const report = {
|
|
264
|
+
timestamp: new Date().toISOString(),
|
|
265
|
+
results: this.results,
|
|
266
|
+
system: {
|
|
267
|
+
nodeVersion: process.version,
|
|
268
|
+
platform: process.platform,
|
|
269
|
+
arch: process.arch,
|
|
270
|
+
memory: process.memoryUsage()
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
await fs.mkdir(path.dirname(reportPath), { recursive: true });
|
|
275
|
+
await fs.writeFile(reportPath, JSON.stringify(report, null, 2));
|
|
276
|
+
|
|
277
|
+
console.log(`\nš¾ Benchmark results saved: ${reportPath}`);
|
|
278
|
+
} catch (error) {
|
|
279
|
+
console.warn('ā ļø Could not save benchmark results:', error.message);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// CLI usage
|
|
285
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
286
|
+
const benchmark = new PerformanceBenchmark();
|
|
287
|
+
|
|
288
|
+
benchmark.runBenchmark(3).then(async (results) => {
|
|
289
|
+
await benchmark.saveBenchmarkResults();
|
|
290
|
+
|
|
291
|
+
// Exit with appropriate code
|
|
292
|
+
const improvement = results.improvement.percentage;
|
|
293
|
+
process.exit(improvement > 30 ? 0 : 1);
|
|
294
|
+
}).catch(error => {
|
|
295
|
+
console.error('ā Benchmark failed:', error);
|
|
296
|
+
process.exit(1);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export default PerformanceBenchmark;
|
|
File without changes
|
|
File without changes
|