← スキル一覧に戻る

performance-profiling
by Smarter-Poker
Smarter-Poker-World-Hub
⭐ 0🍴 0📅 2026年1月26日
SKILL.md
name: Performance Profiling description: Web performance analysis, Core Web Vitals, and optimization
Performance Profiling Skill
Lighthouse Audits
CLI Usage
# Run full audit
lighthouse https://smarter.poker --output=json --output-path=./lighthouse-report.json
# Specific categories
lighthouse https://smarter.poker --only-categories=performance,accessibility
# Mobile emulation
lighthouse https://smarter.poker --preset=perf --emulated-form-factor=mobile
Programmatic
const lighthouse = require('lighthouse');
const chromeLauncher = require('chrome-launcher');
async function runLighthouse(url) {
const chrome = await chromeLauncher.launch({chromeFlags: ['--headless']});
const result = await lighthouse(url, {port: chrome.port});
await chrome.kill();
return result.lhr;
}
Core Web Vitals
Metrics to Track
- LCP (Largest Contentful Paint) - < 2.5s
- FID (First Input Delay) - < 100ms
- CLS (Cumulative Layout Shift) - < 0.1
- INP (Interaction to Next Paint) - < 200ms
- TTFB (Time to First Byte) - < 800ms
Measurement Code
import { onLCP, onFID, onCLS, onINP, onTTFB } from 'web-vitals';
onLCP(console.log);
onFID(console.log);
onCLS(console.log);
onINP(console.log);
onTTFB(console.log);
Bundle Analysis
Next.js Bundle Analyzer
// next.config.js
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({});
// Run: ANALYZE=true npm run build
Webpack Bundle Analyzer
npx webpack-bundle-analyzer stats.json
Network Performance
Compression Check
# Check if gzip/brotli enabled
curl -I -H "Accept-Encoding: gzip, deflate, br" https://smarter.poker | grep -i content-encoding
Resource Timing API
const resources = performance.getEntriesByType('resource');
resources.forEach(r => {
console.log(`${r.name}: ${r.duration}ms`);
});
Memory Profiling
Chrome DevTools Memory
- Open DevTools > Memory tab
- Take heap snapshot
- Perform actions
- Take another snapshot
- Compare for leaks
Node.js Memory
# Run with memory tracking
node --inspect --expose-gc app.js
# Check memory usage
process.memoryUsage();
Database Performance
Query Analysis
-- Explain query plan
EXPLAIN ANALYZE SELECT * FROM large_table WHERE condition;
-- Check slow queries in Supabase
SELECT * FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
Optimization Checklist
- Images optimized (WebP, proper sizing)
- JavaScript code-split
- CSS inlined for critical path
- Fonts preloaded
- Third-party scripts deferred
- CDN for static assets
- HTTP/2 or HTTP/3 enabled
- Caching headers set
- Gzip/Brotli compression
- Database queries indexed
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です