1.4 KiB
1.4 KiB
name, description, disable-model-invocation
| name | description | disable-model-invocation |
|---|---|---|
| performance | Performance optimization workflow for frontend applications | true |
Performance
Optimize: $ARGUMENTS
Process
-
Identify the problem
- What is slow? (initial load, interaction, render)
- Measure current performance
- Set a target improvement
-
Analyze causes
- Large bundle size?
- Unnecessary re-renders?
- Expensive calculations?
- Network waterfalls?
- Layout thrashing?
-
React optimizations
- Add
memo()for expensive list items - Use
useMemofor costly computations - Use
useCallbackfor stable function refs - Split components to isolate re-renders
- Lazy load with
dynamic()orReact.lazy()
- Add
-
Bundle optimizations
- Code split large dependencies
- Dynamic imports for heavy features
- Tree shake unused code
- Analyze with bundle analyzer
-
Render optimizations
- Virtualize long lists
- Debounce/throttle frequent updates
- Use CSS transforms over layout properties
- Avoid layout shifts
-
Network optimizations
- Preload critical resources
- Cache API responses
- Optimize images (WebP, lazy load)
- Reduce request waterfalls
-
Verify improvement
- Measure after changes
- Compare to baseline
- Test on slow devices/networks
Output
Report optimizations applied and measured improvements.