Skip to content

Latest commit

 

History

History
128 lines (95 loc) · 2.87 KB

File metadata and controls

128 lines (95 loc) · 2.87 KB
title Performance Optimization — Module User
type documentation
created 2026-05-11
updated 2026-05-11
tags
performance
optimization
tokens
context
related
./00-index-1.md
./00-index.md
./2fa-guide.md
./2fa.md
./accessor-delegation-pattern.md
./actions-path-convention-1.md
./actions-path-convention-2.md
./actions-path-convention.md

Performance Optimization — Module User

Ottimizzazioni Applicate

1. On-Demand Loading (principale)

Prima: Bootstrap caricava tutte le rules (50K+ token) Dopo: Carico solo what's needed (~2K startup)

```diff

  • 150+ rules embeddate in AGENTS.md
  • 0 rules embeddate — tutte on-demand ```

2. Cache Esterna al Repo

```diff

  • .cache/ (8KB nel repo)
  • ~/.cache/qmd-cache/ (fuori da git) ```

Risultato:

  • Clone più veloce (nessuna cache da scaricare)
  • Git history pulito
  • Nessun rischio di commit cache

3. Node Modules Puliti

```diff

  • bashscripts/ai/.agents/node_modules/ (58MB)
  • laravel/node_modules/ (singola installazione) ```

4. Wiki Indici Locali

Ogni modulo ha i propri rules/skills/commands/memories/INDEX.md:

  • Ricerca più rapida (scope limitato)
  • Context rilevante per il modulo
  • Non mischia contenuti eterogenei

Metriche Attuali

Metric Before After
Token startup ~50,000 ~2,000
Context usage 90% 60-70%
Ricerca regole 500ms (grep) 30ms (qmd)
Repo size +58MB -58MB
Cache in git 8KB tracked 0KB

Best Practice per Sviluppatori

Caricamento Efficiente

```python

❌ MAI fare così

Read all_rules = Read docs/wiki/rules/*.md # TOO MANY TOKENS

✅ SEMPRE fare così

trigger = detect_task_trigger() if trigger in trigger_map: Read specific_rule = Read docs/wiki/rules/$trigger.md ```

Query QMD Efficienti

```bash

❌ Troppo generico — risultati enormi

qmd search "form"

✅ Specifico — risultati precisi

qmd search "filament form schema conventions" ```

Limitare lo Scope

```bash

Cerca solo nel modulo corrente

qmd search "validation" -c user

Cerca globalmente (solo se necessario)

qmd search "global validation rules" ```

Prossimi Miglioramenti (TODO)

  1. Auto-index rebuild — Dopo 500 file changes, qmd index rebuild
  2. Hooks pre-task — Auto-memory sync
  3. Context-mode batch — Convertire script in batch exec
  4. Permissions allowlist — .claude/settings.json

Monitoring

Controlla performance attuali:

```bash

Dimensione cache

du -sh ~/.cache/qmd-cache/

Token usage (se disponibile)

context-mode ctx-stats ```

Riferimenti


Status: Ottimizzato | Token risparmiati: ~48K per session