β‘ Performance Optimization
Master ECC's performance optimization techniques to make your development experience smoother and more efficient.
Model Selection Strategyβ
ECC supports multiple AI models. Choosing the right model can significantly boost efficiency:
π Haiku 4.5 (Lightweight Tasks)β
Features: 90% of Sonnet's capability, 3x cost savings
Use cases:
- Lightweight agents
- High-frequency tasks
- Pair programming and code generation
- Worker roles in multi-agent systems
π― Sonnet 4.5 (Primary Model)β
Features: Best coding model
Use cases:
- Primary development work
- Multi-agent workflow orchestration
- Complex coding tasks
π§ Opus 4.5 (Deep Reasoning)β
Features: Strongest reasoning capabilities
Use cases:
- Complex architectural decisions
- Problems requiring deep reasoning
- Research and analysis tasks
Context Window Managementβ
Avoiding Context Overflowβ
When the context is approaching its limit, avoid:
- β Large-scale refactoring
- β Cross-file feature implementation
- β Complex debugging sessions
Low Context-Sensitivity Tasksβ
These tasks are not sensitive to context:
- β Single-file edits
- β Independent utility functions
- β Documentation updates
- β Simple bug fixes
Context Optimization Tipsβ
# β
Break large tasks into batches
/plan Refactor user module # Plan first
/tdd --feature="user-model" # Implement step by step
/tdd --feature="user-service"
/tdd --feature="user-controller"
# β Process everything at once
Refactor the entire user system... # May exceed context
Extended Thinkingβ
Default Configurationβ
Extended Thinking is enabled by default, reserving up to 31,999 tokens for internal reasoning.
Controlsβ
| Method | Description |
|---|---|
Option+T / Alt+T | Toggle on/off |
settings.json | Configure alwaysThinkingEnabled |
| Environment variable | MAX_THINKING_TOKENS=10000 |
Ctrl+O | View thinking process |
When to Enable Deep Thinkingβ
# β
Enable deep thinking for complex tasks
/plan Design a microservices architecture
# β
Use Plan Mode for structured analysis
Enable Plan Mode...
# For simple tasks, disable to improve speed
Option+T to toggle off
Build Performance Optimizationβ
Incremental Buildsβ
# β
Use incremental builds
npm run build -- --incremental
# β
Use caching
npm run build -- --cache
Parallel Processingβ
# β
Execute independent tasks in parallel
Run simultaneously:
1. Type checking
2. Lint checking
3. Unit tests
Hook Performanceβ
Keep Hooks Lightweightβ
{
"hooks": {
"postToolUse": [
{
"name": "quick-format",
"trigger": "*.ts",
"command": "prettier --write",
"timeout": 5000
}
]
}
}
Avoid Heavy Hooksβ
// β Avoid running in postToolUse
{
"name": "full-test",
"command": "npm test" // Too slow!
}
// β
Use stop hook instead
{
"name": "full-test",
"trigger": "stop",
"command": "npm test"
}
Diagnostic Toolsβ
Performance Analysis Commandsβ
# Analyze a specific file
/perf --file=src/heavy-module.ts
# Analyze overall performance
/perf --profile
# Memory analysis
/perf --memory
Build Troubleshootingβ
# Use the dedicated agent
/build-and-fix
# View detailed logs
DEBUG=* npm run build
Performance Checklistβ
- Choose the right model (Haiku/Sonnet/Opus)
- Manage context size
- Use incremental builds
- Keep hooks lightweight
- Break large tasks into batches
- Execute independent tasks in parallel
π‘ Tip: The core of performance optimization is using the right tool for the right job β don't use a sledgehammer to crack a nut!