Skip to content

(Large numbers of) Neopixel and Dotstar are slow #884

@rhooper

Description

@rhooper

Both Neopixel and Dotstar take a lot of cycles to update pixels. There's two different things going on that slow down both. The first is that converting from Int or RGB[W] to the bytearray is complex code that makes updating pixels slow. The penalty for more pixels is O(N) (as one would expect).

The second issue is that when brightness<1, extra work is done during .show() - the bytearray is copied and every pixel value recomputed. This probably also causes unnecessary garbage collection, and has helped me run out of memory later on in runtime through apparent fragmentation.

This technically isn't a core CircuitPython issue, but because it requires a C helper to address, some work is likely needed in CircuitPython to add helpers to speed up these tasks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions