// Simple profiling
const timers = new Map<string, number>()
export function startTimer(name: string) {
timers.set(name, Date.now())
}
export function endTimer(name: string) {
const start = timers.get(name)
if (!start) return
console.log(`${name}: ${Date.now() - start}ms`)
timers.delete(name)
}
// Usage
startTimer('db-query')
const users = await db.query('SELECT * FROM users')
endTimer('db-query')
Query Optimization
-- Use EXPLAIN ANALYZE
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';
-- Add indexes
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_orders_user_id ON orders(user_id, created_at DESC);
Caching Strategy
Data Type
TTL
Strategy
User session
24h
Redis
Config
1h
Memory
Product catalog
1h
Redis + CDN
API responses
1min
Cache-aside
Checklist
Profile critical paths
Optimize database queries
Add appropriate indexes
Implement caching
Set up load testing
Monitor Core Web Vitals (frontend)
1---2name: performance3description: Performance Engineering4---5# Performance Engineering67## Bottleneck Detection89```typescript10// Simple profiling11const timers = new Map<string, number>()1213export function startTimer(name: string) {14 timers.set(name, Date.now())15}1617export function endTimer(name: string) {18 const start = timers.get(name)19 if (!start) return20 console.log(`${name}: ${Date.now() - start}ms`)21 timers.delete(name)22}2324// Usage25startTimer('db-query')26const users = await db.query('SELECT * FROM users')27endTimer('db-query')28```2930## Query Optimization3132```sql33-- Use EXPLAIN ANALYZE34EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';3536-- Add indexes37CREATE INDEX idx_users_email ON users(email);38CREATE INDEX idx_orders_user_id ON orders(user_id, created_at DESC);39```4041## Caching Strategy4243| Data Type | TTL | Strategy |44|-----------|-----|----------|45| User session | 24h | Redis |46| Config | 1h | Memory |47| Product catalog | 1h | Redis + CDN |48| API responses | 1min | Cache-aside |4950## Checklist5152- [ ] Profile critical paths53- [ ] Optimize database queries54- [ ] Add appropriate indexes55- [ ] Implement caching56- [ ] Set up load testing57- [ ] Monitor Core Web Vitals (frontend)
Run npx skillmds@latest add johnalbertini14-glitch/performance in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Performance Engineering It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
johnalbertini14-glitch (@johnalbertini14-glitch) published this skill. Their other Agent Skills are listed on their SkillMD profile.