Optimize WLED processing pipeline and add FPS metrics
- Add numpy-based DDP pixel packing (send_pixels_numpy) and fast send path (send_pixels_fast) eliminating per-pixel Python loops - Move ProcessedLiveStream filter processing to background thread so get_latest_frame() returns pre-computed cached result instantly - Vectorize map_border_to_leds for average interpolation using cumulative sums instead of 934 individual np.mean calls (~16ms -> <1ms) - Batch all CPU work into single asyncio.to_thread call per frame - Fix FPS calculation to measure frame-to-frame interval (was measuring processing time only, reporting inflated values) - Add Potential FPS metric showing theoretical max without throttling - Add FPS label to WLED target card properties - Add fps_potential field to TargetProcessingState API schema Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -123,6 +123,7 @@ class TargetProcessingState(BaseModel):
|
||||
device_id: Optional[str] = Field(None, description="Device ID")
|
||||
processing: bool = Field(description="Whether processing is active")
|
||||
fps_actual: Optional[float] = Field(None, description="Actual FPS achieved")
|
||||
fps_potential: Optional[float] = Field(None, description="Potential FPS (processing speed without throttle)")
|
||||
fps_target: int = Field(default=0, description="Target FPS")
|
||||
display_index: int = Field(default=0, description="Current display index")
|
||||
last_update: Optional[datetime] = Field(None, description="Last successful update")
|
||||
|
||||
Reference in New Issue
Block a user