Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Identifies and fixes performance bottlenecks in code, databases, and APIs. Measures before and after to prove improvements.
.claude/skills/davila7-performance-optimizer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-21 | ✗→✓ | ▲ Improved | 134% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 133% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 351% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 223% | 0% |
Find and fix performance bottlenecks. Measure, optimize, verify. Make it fast.
Never optimize without measuring:
javascript// Measure execution time console.time('operation'); await slowOperation(); console.timeEnd('operation'); // operation: 2341ms
What to measure:
Use profiling tools to find the slow parts:
Browser:
DevTools → Performance tab → Record → Stop
Look for long tasks (red bars)Node.js:
bashnode --prof app.js node --prof-process isolate-*.log > profile.txt
Database:
sqlEXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';
Fix the slowest thing first (biggest impact).
Problem: N+1 Queries
javascript// Bad: N+1 queries const users = await db.users.find(); for (const user of users) { user.posts = await db.posts.find({ userId: user.id }); // N queries } // Good: Single query with JOIN const users = await db.users.find() .populate('posts'); // 1 query
Problem: Missing Index
sql-- Check slow query EXPLAIN SELECT * FROM users WHERE email = 'test@example.com'; -- Shows: Seq Scan (bad) -- Add index CREATE INDEX idx_users_email ON users(email); -- Check again EXPLAIN SELECT * FROM users WHERE email = 'test@example.com'; -- Shows: Index Scan (good)
Problem: SELECT
javascript// Bad: Fetches all columns const users = await db.query('SELECT * FROM users'); // Good: Only needed columns const users = await db.query('SELECT id, name, email FROM users');
Problem: No Pagination
javascript// Bad: Returns all records const users = await db.users.find(); // Good: Paginated const users = await db.users.find() .limit(20) .skip((page - 1) * 20);
Problem: No Caching
javascript// Bad: Hits database every time app.get('/api/stats', async (req, res) => { const stats = await db.stats.calculate(); // Slow res.json(stats); }); // Good: Cache for 5 minutes const cache = new Map(); app.get('/api/stats', async (req, res) => { const cached = cache.get('stats'); if (cached && Date.now() - cached.time < 300000) { return res.json(cached.data); } const stats = await db.stats.calculate(); cache.set('stats', { data: stats, time: Date.now() }); res.json(stats); });
Problem: Sequential Operations
javascript// Bad: Sequential (slow) const user = await getUser(id); const posts = await getPosts(id); const comments = await getComments(id); // Total: 300ms + 200ms + 150ms = 650ms // Good: Parallel (fast) const [user, posts, comments] = await Promise.all([ getUser(id), getPosts(id), getComments(id) ]); // Total: max(300ms, 200ms, 150ms) = 300ms
Problem: Large Payloads
javascript// Bad: Returns everything res.json(users); // 5MB response // Good: Only needed fields res.json(users.map(u => ({ id: u.id, name: u.name, email: u.email }))); // 500KB response
Problem: Unnecessary Re-renders
javascript// Bad: Re-renders on every parent update function UserList({ users }) { return users.map(user => <UserCard user={user} />); } // Good: Memoized const UserCard = React.memo(({ user }) => { return <div>{user.name}</div>; });
Problem: Large Bundle
javascript// Bad: Imports entire library import _ from 'lodash'; // 70KB // Good: Import only what you need import debounce from 'lodash/debounce'; // 2KB
Problem: No Code Splitting
javascript// Bad: Everything in one bundle import HeavyComponent from './HeavyComponent'; // Good: Lazy load const HeavyComponent = React.lazy(() => import('./HeavyComponent'));
Problem: Unoptimized Images
html<!-- Bad: Large image --> <img src="photo.jpg" /> <!-- 5MB --> <!-- Good: Optimized and responsive --> <img src="photo-small.webp" srcset="photo-small.webp 400w, photo-large.webp 800w" loading="lazy" width="400" height="300" /> <!-- 50KB -->
Problem: Inefficient Algorithm
javascript// Bad: O(n²) - nested loops function findDuplicates(arr) { const duplicates = []; for (let i = 0; i < arr.length; i++) { for (let j = i + 1; j < arr.length; j++) { if (arr[i] === arr[j]) duplicates.push(arr[i]); } } return duplicates; } // Good: O(n) - single pass with Set function findDuplicates(arr) { const seen = new Set(); const duplicates = new Set(); for (const item of arr) { if (seen.has(item)) duplicates.add(item); seen.add(item); } return Array.from(duplicates); }
Problem: Repeated Calculations
javascript// Bad: Calculates every time function getTotal(items) { return items.reduce((sum, item) => sum + item.price * item.quantity, 0); } // Called 100 times in render // Good: Memoized const getTotal = useMemo(() => { return items.reduce((sum, item) => sum + item.price * item.quantity, 0); }, [items]);
Problem: Memory Leak
javascript// Bad: Event listener not cleaned up useEffect(() => { window.addEventListener('scroll', handleScroll); // Memory leak! }, []); // Good: Cleanup useEffect(() => { window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []);
Problem: Large Data in Memory
javascript// Bad: Loads entire file into memory const data = fs.readFileSync('huge-file.txt'); // 1GB // Good: Stream it const stream = fs.createReadStream('huge-file.txt'); stream.on('data', chunk => process(chunk));
Always measure before and after:
javascript// Before optimization console.time('query'); const users = await db.users.find(); console.timeEnd('query'); // query: 2341ms // After optimization (added index) console.time('query'); const users = await db.users.find(); console.timeEnd('query'); // query: 23ms // Improvement: 100x faster!
Set targets:
Page Load: < 2 seconds
API Response: < 200ms
Database Query: < 50ms
Bundle Size: < 200KB
Time to Interactive: < 3 secondsBrowser:
Node.js:
node --prof (profiling)clinic (diagnostics)autocannon (load testing)Database:
EXPLAIN ANALYZE (query plans)Monitoring:
Easy optimizations with big impact:
@database-design - Query optimization@codebase-audit-pre-push - Code review@bug-hunter - Debugging| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | pass→pass | 9,128 | 8,889 | -3% | 1 | 1 | 0% | 1,773 | 4,134 | +133% | 0 | 0 | — |
case-01 | fail→fail | 8,020 | 5,578 | -30% | 1 | 1 | 0% | 1,307 | 3,415 | +161% | 0 | 0 | — |
case-03 | pass→pass | 3,823 | 4,179 | +9% | 1 | 1 | 0% | 688 | 3,102 | +351% | 0 | 0 | — |
case-04 | pass→pass | 6,043 | 5,147 | -15% | 1 | 1 | 0% | 1,058 | 3,419 | +223% | 0 | 0 | — |
case-05 | fail→fail | 6,728 | 6,629 | -1% | 1 | 1 | 0% | 1,238 | 3,756 | +203% | 0 | 0 | — |
case-06 | pass→pass | 11,918 | 9,695 | -19% | 1 | 1 | 0% | 2,171 | 4,369 | +101% | 0 | 0 | — |
case-07 | pass→pass | 8,592 | 5,287 | -38% | 1 | 1 | 0% | 1,915 | 3,648 | +90% | 0 | 0 | — |
case-08 | pass→pass | 9,773 | 6,780 | -31% | 1 | 1 | 0% | 1,804 | 3,805 | +111% | 0 | 0 | — |
case-09 | pass→pass | 4,044 | 3,834 | -5% | 1 | 1 | 0% | 830 | 3,141 | +278% | 0 | 0 | — |
case-10 | pass→pass | 7,536 | 3,849 | -49% | 1 | 1 | 0% | 1,627 | 3,129 | +92% | 0 | 0 | — |
case-11 | pass→pass | 9,135 | 5,289 | -42% | 1 | 1 | 0% | 1,854 | 3,468 | +87% | 0 | 0 | — |
case-12 | pass→pass | 11,243 | 7,399 | -34% | 1 | 1 | 0% | 2,308 | 3,998 | +73% | 0 | 0 | — |
case-13 | pass→pass | 3,270 | 3,475 | +6% | 1 | 1 | 0% | 704 | 3,207 | +356% | 0 | 0 | — |
case-14 | pass→pass | 2,120 | 3,333 | +57% | 1 | 1 | 0% | 400 | 3,019 | +655% | 0 | 0 | — |
case-15 | pass→pass | 7,101 | 5,623 | -21% | 1 | 1 | 0% | 1,532 | 3,585 | +134% | 0 | 0 | — |
case-16 | pass→pass | 9,300 | 9,538 | +3% | 1 | 1 | 0% | 2,062 | 4,366 | +112% | 0 | 0 | — |
case-17 | pass→pass | 11,394 | 1,924 | -83% | 1 | 1 | 0% | 2,215 | 2,759 | +25% | 0 | 0 | — |
case-18 | pass→pass | 3,470 | 1,935 | -44% | 1 | 1 | 0% | 681 | 2,780 | +308% | 0 | 0 | — |
case-19 | pass→pass | 4,880 | 3,818 | -22% | 1 | 1 | 0% | 845 | 3,184 | +277% | 0 | 0 | — |
case-20 | fail→fail | 8,310 | 6,242 | -25% | 1 | 1 | 0% | 1,560 | 3,514 | +125% | 0 | 0 | — |
case-21 | fail→pass | 10,311 | 6,707 | -35% | 1 | 1 | 0% | 1,546 | 3,613 | +134% | 0 | 0 | — |
case-22 | fail→pass | 12,268 | 7,142 | -42% | 1 | 1 | 0% | 2,099 | 3,621 | +73% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.