| name | performance-check |
| description | Performance review checklist for optimization, scalability, and resource usage. Use when changes affect queries, APIs, rendering, caching, or algorithms. Not for simple config changes. |
| version | 1.0.0 |
| author | SublinkPro Team |
| user-invocable | true |
Performance Check Skill
This skill provides a comprehensive performance review checklist for code changes that may impact application performance, scalability, or resource usage.
When to use: When making changes to:
- Database queries and models
- API endpoints (especially list/search operations)
- Frontend rendering logic
- Background jobs and scheduled tasks
- Caching mechanisms
- Large data processing
- File operations
- Network requests
- Recursive algorithms
Performance Check Checklist
🗄️ 1. Database Query Optimization
Check for:
Detailed guide: references/database-optimization.md (includes code examples)
⚡ 2. API Response Optimization
Check for:
Detailed guide: references/api-optimization.md (includes load testing example)
🎨 3. Frontend Rendering Optimization
Check for:
Detailed guide: references/frontend-optimization.md (includes memoization example)
💾 4. Caching Strategy
Check for:
Detailed guide: references/caching-strategies.md
🔄 5. Concurrency & Parallelization
Check for:
Detailed guide: references/concurrency-guide.md (includes goroutine pool pattern)
📦 6. Memory Management
Check for:
Detailed guide: references/memory-management.md
🌐 7. Network & HTTP Optimization
Check for:
Detailed guide: references/network-optimization.md
🔍 8. Algorithm Complexity
Check for:
Detailed guide: references/algorithm-complexity.md
Performance Testing
Backend Benchmarks
go test -bench=. -benchmem ./services/
go test -cpuprofile=cpu.prof -memprofile=mem.prof -bench=.
go tool pprof cpu.prof
API Load Testing
ab -n 1000 -c 10 http://localhost:8000/api/v1/nodes
k6 run assets/load-test.js
Frontend Performance
Run Lighthouse in Chrome DevTools (F12 → Lighthouse tab):
- First Contentful Paint (FCP): < 1.8s
- Largest Contentful Paint (LCP): < 2.5s
- Time to Interactive (TTI): < 3.8s
- Cumulative Layout Shift (CLS): < 0.1
Performance Monitoring
Backend Instrumentation
import "time"
func (s *Service) CriticalOperation() error {
start := time.Now()
defer func() {
log.Infof("Operation duration: %v", time.Since(start))
}()
}
Database Query Monitoring
Enable slow query logging in development:
db, err := gorm.Open(sqlite.Open(dsn), &gorm.Config{
Logger: logger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{
SlowThreshold: 200 * time.Millisecond,
LogLevel: logger.Warn,
}),
})
Fallback Strategy
If performance issues are unclear:
- Use profiler to locate actual bottlenecks (
pprof, Chrome DevTools)
- Measure before optimizing (benchmarks, load tests)
- Focus on hot paths (90/10 rule - 90% of time in 10% of code)
- Don't guess - profile and measure
Exit Criteria
References
Codebase
services/mihomo/mihomo.go - Core performance-critical service
services/scheduler/speedtest_task.go - Concurrent node testing example
webs/src/views/nodes/ - Frontend list rendering patterns
External