colorchord icon indicating copy to clipboard operation
colorchord copied to clipboard

Linear Output with is_loop has Poor Performance

Open CaiB opened this issue 7 months ago • 0 comments

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: image

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.

CaiB avatar Nov 29 '23 16:11 CaiB