adafruit / Adafruit_CircuitPython_framebuf

CircuitPython framebuf module, based on the Python framebuf module
MIT License
39 stars 36 forks source link

framebuf.text() function is very slow #46

Open s-ol opened 2 years ago

s-ol commented 2 years ago

Printing just 10 characters with the default font on a RP2040 MCU takes long enough to visibly stall a realtime LED animation. According to time.monotonic_ns(), 10 characters take 50ms, but I'm not sure if this is an accurate way to measure the delay.

Micropython does not have any issue keeping a high framerate rendering text. I'm not sure if the delay is because the CircuitPython implementation is because it is implemented in pure python or because it does file IO to read the font. If the file IO is the limiting factor, it would be a good idea to offer a RAM-based font option for platforms where that is not a significant limitation.