Skip to content

Investigate GPGPU for DMX effects & scene computationΒ #53

@timekadel

Description

@timekadel

πŸš€ Performance Optimization: CPU vs. GPU Compute Shader

πŸ” Bottlenecks in CPU-Based Processing

  1. Looping through thousands of channels per frame
    • High CPU usage due to sequential waveform calculations (sin, asin, etc.).
  2. CPU β†’ GPU Data Transfers
    • Expensive per-frame updates causing sync bottlenecks.
  3. Blocking the Event Loop
    • Increased frame latency, UI lag, and potential dropped frames.

πŸ“Š Optimization Gains with GPU Compute Shaders

Metric Before (CPU-Based) After (GPU-Based Compute Shader) Optimization
Event Loop CPU Load 50%-90% (if 10,000+ channels) ~1-5% (almost zero) 90%+ reduction πŸ”₯
Per-Frame Latency (ms) 10ms+ (laggy) <1ms (real-time) 10x-100x faster πŸš€
Max Channels Before Lag ~512-2000 max 100,000+ (limited by VRAM) 50x-100x more channels ⚑
Dropped Frames Frequent (>16ms frames) Zero (smooth 60+ FPS) 100% smoother UI 🎨

πŸ“Œ Key Takeaways

  • Near-zero CPU usage β†’ Frees up event loop for UI & networking.
  • Scalable to 100,000+ channels β†’ No DMX universe limits.
  • Eliminates CPU bottleneck β†’ Frame rates stay at 60-144 FPS.
  • Memory-efficient GPU processing β†’ Uses textures instead of CPU loops.

🎯 Estimated Final Optimization

πŸ’‘ 90%+ reduction in CPU load, 10x-100x faster execution, and 50x more channels before lag!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions