You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to iterate over a buffer to read or copy data, I currently have to use a pattern like this:
for (inti = 0; i < buffer.getLength(); i++) {
Colorc = buffer.getLED(i);
}
This results in an object allocation for each LED in the buffer. If this code has to run periodically then this can easily result in thousands of new objects per second, even for lower density LED strips like 60/meter - 60 LEDs * 1 object/LED * 50Hz = 3000 objects/sec.
Let's add methods to read the individual R, G, and B channel values directly. A functional-style iterator method would be nice to have to avoid unnecessary indexed for-loops
If I want to iterate over a buffer to read or copy data, I currently have to use a pattern like this:
This results in an object allocation for each LED in the buffer. If this code has to run periodically then this can easily result in thousands of new objects per second, even for lower density LED strips like 60/meter - 60 LEDs * 1 object/LED * 50Hz = 3000 objects/sec.
Let's add methods to read the individual R, G, and B channel values directly. A functional-style iterator method would be nice to have to avoid unnecessary indexed for-loops
The text was updated successfully, but these errors were encountered: