remixer-dec / M5Stack_Experiments

small projects made for M5StickC and UnitV IoT development boards from M5Stack
https://m5stack.hackster.io/remixer-dec/9-micropython-mini-projects-for-m5stickc-c07eb1
MIT License
16 stars 6 forks source link

Suggestions for optimizations in fire animation #2

Open frans-fuerst opened 9 months ago

frans-fuerst commented 9 months ago

Hey, not really an 'issue' - I've taken your fire animation because I wanted to play with native/viper and I needed a MicroPython fire animation.. thanks! I've modified it a little bit and managed to bring it down to ~300ms/frame using native/viper only. You can find it here in case you're interested:

https://projects.om-office.de/frans/m5stickc_multitool/-/blob/main/fire.py

Modifications involved removing some calls to int (surprisingly big impact), more uses of array, less nested arrays, drawing (3 or more) pixel blocks rather than each pixel individually and setting the clock to 240MHz.

remixer-dec commented 9 months ago

Hi! Good job! It's great to see that you found a few ways to optimize it. I haven't really touched micropython for a few years, but someday I'll give it a try!

P.S. added a link to your fork to readme