Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 line
3.6 KiB
JSON

{"content": "---\nallowed-tools: Read, Bash, Grep, Glob\nargument-hint: [target-area] | --frontend | --backend | --full\ndescription: Comprehensive performance audit with metrics, bottleneck identification, and optimization recommendations\n---\n\n# Performance Audit\n\nConduct comprehensive performance audit: $ARGUMENTS\n\n## Current Performance Context\n\n- Bundle analysis: !`npm run build -- --analyze 2>/dev/null || echo \"No build analyzer\"`\n- Dependencies: !`npm list --depth=0 --prod 2>/dev/null | head -10`\n- Build time: !`time npm run build >/dev/null 2>&1 || echo \"No build script\"`\n- Performance config: @webpack.config.js or @vite.config.js or @next.config.js (if exists)\n\n## Task\n\nConduct comprehensive performance audit following these steps:\n\n1. **Technology Stack Analysis**\n - Identify the primary language, framework, and runtime environment\n - Review build tools and optimization configurations\n - Check for performance monitoring tools already in place\n\n2. **Code Performance Analysis**\n - Identify inefficient algorithms and data structures\n - Look for nested loops and O(n²) operations\n - Check for unnecessary computations and redundant operations\n - Review memory allocation patterns and potential leaks\n\n3. **Database Performance**\n - Analyze database queries for efficiency\n - Check for missing indexes and slow queries\n - Review connection pooling and database configuration\n - Identify N+1 query problems and excessive database calls\n\n4. **Frontend Performance (if applicable)**\n - Analyze bundle size and chunk optimization\n - Check for unused code and dependencies\n - Review image optimization and lazy loading\n - Examine render performance and re-render cycles\n - Check for memory leaks in UI components\n\n5. **Network Performance**\n - Review API call patterns and caching strategies\n - Check for unnecessary network requests\n - Analyze payload sizes and compression\n - Examine CDN usage and static asset optimization\n\n6. **Asynchronous Operations**\n - Review async/await usage and promise handling\n - Check for blocking operations and race conditions\n - Analyze task queuing and background processing\n - Identify opportunities for parallel execution\n\n7. **Memory Usage**\n - Check for memory leaks and excessive memory consumption\n - Review garbage collection patterns\n - Analyze object lifecycle and cleanup\n - Identify large objects and unnecessary data retention\n\n8. **Build & Deployment Performance**\n - Analyze build times and optimization opportunities\n - Review dependency bundling and tree shaking\n - Check for development vs production optimizations\n - Examine deployment pipeline efficiency\n\n9. **Performance Monitoring**\n - Check existing performance metrics and monitoring\n - Identify key performance indicators (KPIs) to track\n - Review alerting and performance thresholds\n - Suggest performance testing strategies\n\n10. **Benchmarking & Profiling**\n - Run performance profiling tools appropriate for the stack\n - Create benchmarks for critical code paths\n - Measure before and after optimization impact\n - Document performance baselines\n\n11. **Optimization Recommendations**\n - Prioritize optimizations by impact and effort\n - Provide specific code examples and alternatives\n - Suggest architectural improvements for scalability\n - Recommend appropriate performance tools and libraries\n\nInclude specific file paths, line numbers, and measurable metrics where possible. Focus on high-impact, low-effort optimizations first."}