A powerful performance analysis tool for React components that detects unnecessary re-renders, measures render times, and provides optimization suggestions.
- ๐ Render Count Tracking: Monitor how many times a component re-renders and detect unnecessary re-renders
- โฑ๏ธ Render Time Measurement: Measure the time taken for initial and subsequent renders
- ๐ง State Update Monitoring: Track state changes and detect redundant updates
- ๐ ๏ธ Performance Recommendations: Get actionable suggestions for optimizing your component
# Install globally
npm install -g blinkreact
# Or use npx without installing
npx blinkreact <component-file>blinkreact path/to/your/component.tsxBlinkReact analyzes your React component through a 4-step process:
- ๐งช Instrumentation: Adds performance tracking code to your component
- ๐ Render Analysis: Measures render counts and durations
- ๐ State Analysis: Detects redundant state updates and inefficient patterns
- ๐ Report Generation: Creates a comprehensive performance report
BlinkReact generates a detailed PERFORMANCE_REPORT.md file containing:
| Section | Description |
|---|---|
| ๐ Component Info | Component name and file path |
| โฑ๏ธ Render Metrics | Total renders, render times, unnecessary renders |
| ๐ง State Management | State updates and redundancy analysis |
| ๐ก Recommendations | Actionable optimization suggestions |
- Node.js >= 14.0
- React >= 18.0
Click to expand example report
# BlinkReact Performance Report
## Component: `TodoList`
**File Path:** `src/components/TodoList.tsx`
**Analysis Date:** 2023-05-15 10:30:45
## Render Performance
- **Total Renders:** 5
- **Average Render Time:** 3.45ms
- **Maximum Render Time:** 8.12ms
- **Unnecessary Renders:** 2
## State Management
- **Total State Updates:** 10
- **Redundant State Updates:** 2
## Performance Recommendations
- **Reduce Unnecessary Renders:** Consider using `React.memo()` to prevent re-renders when props haven't changed.
- **Optimize Render Performance:** The component has slow renders. Consider breaking it down into smaller components.
- **Reduce Redundant State Updates:** The component has redundant state updates. Consider using functional updates.Contributions, issues and feature requests are welcome! Feel free to check the issues page.
This project is ISC licensed.
Built with โค๏ธ for the React community
