colorchord
colorchord copied to clipboard
Linear Output with is_loop has Poor Performance
In the Linear visualizer, when is_loop = 1
, the complexity of positioning LEDs around the ring becomes O(n^2), with n being the number of LEDs.
I noticed this while profiling CC.NET when I happened to have a Linear visualizer running with 720 LEDs in this mode. The code is functionally identical:
Location of this loop in ColorChord: https://github.com/cnlohr/colorchord/blob/master/colorchord2/OutputLinear.c#L142-L147
If I get around to fixing it in CC.NET first, I'll let you know or open a PR with a fix. Likewise, if you end up fixing it here first, LMK.