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
It looks like right now main code execute at boot has to be a pure python .py file. This is tricky though since pure python code has a significant memory overhead during parsing. Beyond about 100 lines of code in a main.py it becomes impossible to import a few modules and run code. An easy way around this is switching to .mpy files that are processed ahead of time to reduce their size and parsing memory usage. Let's see if we can support main.mpy/code.mpy files execute on boot for those cases where users need the most memory possible.
The text was updated successfully, but these errors were encountered:
Would you mind posting the main.py file? I'm hesitant to support mpy'd mains because they are opaque files. I'd rather have it always possible to read main and instead factor out stuff into mpy'd libraries.
I believe this is less of an issue now. I believe @tdicola was using ampy to load main.py which copies all of the file contents into memory before parsing. Saving main.py to the internal storage first will mitigate this.
It looks like right now main code execute at boot has to be a pure python .py file. This is tricky though since pure python code has a significant memory overhead during parsing. Beyond about 100 lines of code in a main.py it becomes impossible to import a few modules and run code. An easy way around this is switching to .mpy files that are processed ahead of time to reduce their size and parsing memory usage. Let's see if we can support main.mpy/code.mpy files execute on boot for those cases where users need the most memory possible.
The text was updated successfully, but these errors were encountered: