A comprehensive React application demonstrating the performance differences between Preact Signals and Redux state management solutions through interactive benchmarks and real-time visualizations.
This project provides side-by-side performance comparisons between Signals and Redux, showcasing how different state management approaches affect React application performance, re-render counts, and user experience.
๐ Live Demo: signals-vs-redux.netlify.app
- Basic Comparison: Single Signal vs Redux slice across multiple widgets
- Multi-State Stress Test: Hundreds of independent state slices running simultaneously
- Mixed Environment: Performance impact when both solutions coexist
- Interactive Mutation: Real-time widget manipulation with live performance metrics
- Dynamic Widget Count: Scale from 1 to 1000+ widgets
- Adjustable Intervals: From 16ms (60fps) to custom update rates
- Live Value Editing: Modify individual widget values during runtime
- Performance Monitoring: Real-time FPS and render count tracking
- Re-render Highlighting: Visual indicators for component updates
- Status Indicators: Real-time sync status for each widget
- Animated Progress: Dynamic widgets showing state changes
- Performance Metrics: Built-in timing measurements
src/
โโโ pages/ # Demo routes
โ โโโ signal/ # Pure Signals demo
โ โโโ redux/ # Pure Redux demo
โ โโโ multi-signal/ # Multiple Signal widgets
โ โโโ multi-redux/ # Multiple Redux slices
โ โโโ signal-redux/ # Mixed environment test
โ โโโ incoming-signal/ # Interactive mutation demo
โโโ store/
โ โโโ signal/ # Signal state management
โ โโโ redux/ # Redux state management
โ โโโ combinedState.ts # Mixed state orchestration
โโโ providers/
โโโ ReduxProvider.tsx # Redux provider wrapper
- Frontend: React 19, TypeScript, Tailwind CSS
- State Management:
@preact/signals-react
- Zero-render signals@reduxjs/toolkit
- Modern Redux with RTK
- Build: Vite, ESLint
- Routing: React Router DOM
Route | Description |
---|---|
/signal |
Pure Signals demo with multiple widgets |
/redux |
Pure Redux demo showing re-render overhead |
/multi-signal |
Hundreds of independent Signal widgets |
/multi-redux |
Hundreds of Redux slices (performance stress test) |
/signal-redux |
Mixed environment showing Redux impact on Signals |
/incoming-signal |
Interactive real-time widget value mutation |
- Node.js 18+ or Bun runtime
- Modern browser with React DevTools
# Clone and install
git clone https://github.com/ChiragChrg/Signals-vs-Redux.git
cd Signals-vs-Redux
npm install # or bun install
# Start development
npm run dev # or bun dev
- React Developer Tools - Enable "Highlight updates when components render"
- FPS Monitor - Track real-time rendering performance
- Zero Re-renders: Direct DOM updates bypass React reconciliation
- Granular Updates: Only affected elements update, not component trees
- Consistent 60fps: Performance remains stable regardless of scale
- Memory Efficient: Minimal overhead for state subscriptions
- Component Re-renders:
useSelector()
triggers full component updates - Performance Degradation: Exponential slowdown with scale
- Memory Overhead: Extensive component tree reconciliation
- Cascade Effects: Single state change triggers hundreds of re-renders
Widget Count | Redux FPS | Signals FPS | Performance Gain |
---|---|---|---|
100 | ~45fps | 60fps | +33% |
300 | ~25fps | 60fps | +140% |
500 | ~15fps | 60fps | +300% |
1000+ | <10fps | 60fps | +500%+ |
// Direct DOM manipulation - no React re-renders
effect(() => {
const value = widget?.metric.value || 0;
if (barRef.current) {
barRef.current.style.width = `${value}%`;
}
});
// Traditional pattern - triggers full component re-render
const widget = useSelector((state: RootState) => state[id]);
npm run build # Production build
npm run preview # Preview build locally
npm run lint # Code linting
- Fork the repository
- Create feature branch:
git checkout -b feature/new-feature
- Commit changes:
git commit -m 'Add new feature'
- Push and create Pull Request
This project is licensed under the MIT License.
You are free to use, modify, and share this project, as long as you include the original copyright.
ยฉ 2025 ChiragChrg โ All rights reserved under MIT.
- GitHub: ChiragChrg/Signals-vs-Redux
- Preact Signals: @preact/signals-react
- Redux Toolkit: @reduxjs/toolkit