- gen-perf-test.mjs: synthetische Notizen-Generator 100/200/500 Notizen mit Topics, Tags, Wikilinks - SPEC v3.0: Performance-Section mit Empfehlungen - 100 Notizen: ~12s - 200 Notizen: 25s - 500 Notizen: >60s (gestoppt, TF-IDF wird Bottleneck) - Empfehlung fuer >500: Embedding-basierte Aehnlichkeit statt TF-IDF O(N^2) Verifiziert: - 100 Notizen: 100 Knoten, 200 Kanten, 0 Veraltet, 63 KB landkarte.json - 200 Notizen: 200 Knoten, 400 Kanten - TF-IDF-Pair-Vergleich skaliert quadratisch (z.B. 200 Notizen = 19.900 Vergleiche) - Fuer MVP (Vault <500 Notizen) ist die Performance ausreichend
50 lines
2.2 KiB
JavaScript
50 lines
2.2 KiB
JavaScript
// Performance-Test: 100 Notizen generieren + Indexer laufen lassen
|
|
import { mkdirSync, writeFileSync, rmSync, existsSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
|
|
const TOPICS = ['Kaffee', 'Tee', 'Schlaf', 'Sport', 'Arbeit', 'Familie', 'Reisen', 'Musik', 'Buecher', 'Filme', 'Politik', 'Wissenschaft', 'Technik', 'Essen', 'Meditation', 'Sprachen', 'Geschichte', 'Kunst'];
|
|
const TAGS = ['arbeit', 'privat', 'projekt', 'idee', 'frage', 'notiz', 'reflexion'];
|
|
|
|
const vaultPath = process.argv[2] ?? 'C:/Users/Jannik/AppData/Local/Temp/mindomat-perf-test';
|
|
const count = parseInt(process.argv[3] ?? '100', 10);
|
|
|
|
if (existsSync(vaultPath)) rmSync(vaultPath, { recursive: true, force: true });
|
|
|
|
const dirs = [
|
|
'00_Inbox', '00_Inbox/Verarbeitet', '00_Inbox/Problemfaelle',
|
|
'01_Daily', '10_Wiki', '10_Wiki/Seiten',
|
|
'20_Projekte', '90_Templates',
|
|
'99_System', '99_System/Skripte', '99_System/Logs', '99_System/Cache',
|
|
];
|
|
for (const d of dirs) mkdirSync(join(vaultPath, d), { recursive: true });
|
|
|
|
writeFileSync(join(vaultPath, '99_System/Konfig.md'),
|
|
'---\nveraltet_schwellwert_monate: 12\n---\n');
|
|
|
|
console.log(`Generiere ${count} Notizen...`);
|
|
for (let i = 1; i <= count; i++) {
|
|
const topic = TOPICS[Math.floor(Math.random() * TOPICS.length)];
|
|
const tag = TAGS[Math.floor(Math.random() * TAGS.length)];
|
|
const date = new Date(Date.now() - (i % 30) * 86400000).toISOString().slice(0, 10);
|
|
|
|
const lines = [
|
|
'---',
|
|
`title: ${topic} Notiz ${i}`,
|
|
`created: ${date}`,
|
|
`tags: [${tag}]`,
|
|
'---',
|
|
'',
|
|
`# ${topic} Notiz ${i}`,
|
|
'',
|
|
`Das ist der Inhalt der Notiz ${i} ueber ${topic}. Sie enthaelt mehrere Woerter, damit der Indexer etwas zu indexieren hat. Wikilinks auf [[${topic} Andere Notiz]] und [[Allgemeine Notiz]].`,
|
|
'',
|
|
`${(i % 5 + 1) * 5} Zeilen Text mit verschiedenen Woertern.`,
|
|
`Wichtige Erkenntnisse: Erkenntnis eins, Erkenntnis zwei, Erkenntnis drei.`,
|
|
'Maschine Computer Software Hardware Konfiguration Installation Update Backup Recovery Performance.',
|
|
`Absatz mit mehr Text zu ${topic}: Details, weitere Details, noch mehr Details.`,
|
|
];
|
|
const filename = `${date}_${topic}_Notiz_${i}.md`;
|
|
writeFileSync(join(vaultPath, '01_Daily', filename), lines.join('\n'));
|
|
}
|
|
console.log(`${count} Notizen geschrieben.`);
|