mirror of
https://github.com/pmarchini/Esp32Dimmer.git
synced 2026-02-07 03:08:07 +03:00
Clarify performance analysis: timer frequency and future optimizations
Co-authored-by: pmarchini <49943249+pmarchini@users.noreply.github.com>
This commit is contained in:
@@ -148,20 +148,26 @@ All existing functionality is preserved:
|
|||||||
|
|
||||||
### Current Implementation (Pure Event-Driven)
|
### Current Implementation (Pure Event-Driven)
|
||||||
|
|
||||||
**Timer ISR Frequency:** Still 10,000/sec (100 interrupts × 100 Hz)
|
**Timer ISR Frequency:** 10,000/sec (100 interrupts × 100 Hz) - periodic timer still runs at this rate
|
||||||
|
|
||||||
**Event Processing:** 200-600 events/sec depending on number of dimmers
|
**Event Processing:** 200-600 events/sec depending on number of dimmers (only these events trigger GPIO actions)
|
||||||
|
|
||||||
**Key Improvement:** Events fire at exact times rather than waiting for next tick. No legacy fallback code - pure event-driven architecture.
|
**Key Improvements Over Legacy:**
|
||||||
|
- Events fire at exact calculated times (no polling delay)
|
||||||
|
- ISR only processes scheduled events (no legacy fallback checks)
|
||||||
|
- Pure event-driven architecture - cleaner, more maintainable code
|
||||||
|
- No redundant GPIO checks or counter management
|
||||||
|
|
||||||
### Future Optimization Potential
|
### Future Optimization Potential
|
||||||
|
|
||||||
By switching to one-shot timer mode (future work):
|
The timer currently runs in periodic mode (auto-reload enabled). By switching to one-shot timer mode (future work):
|
||||||
|
|
||||||
**Timer ISR Frequency:** Could reduce to 200-600/sec (only when events fire)
|
**Timer ISR Frequency:** Would reduce to 200-600/sec (only fires when events are scheduled)
|
||||||
|
|
||||||
**Reduction:** 94-98% fewer timer interrupts
|
**Reduction:** 94-98% fewer timer interrupts
|
||||||
|
|
||||||
|
**Implementation:** See FUTURE_ENHANCEMENTS.md for one-shot timer mode plan (Release 2.0.0)
|
||||||
|
|
||||||
## Testing Considerations
|
## Testing Considerations
|
||||||
|
|
||||||
### Manual Testing Required
|
### Manual Testing Required
|
||||||
|
|||||||
Reference in New Issue
Block a user