-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate MICROPY_STACKLESS #3362
Comments
After a heavy amount of testing, I have come to the conclusion that at least for rp2, stackless is stable and offers quite a lot of benefits in comparisson to the current pystack. Building with
in What does all of this mean?
The pr for these changes will be #7396. |
I'll add that I've been running PyDOS "stackless" on both Circuitpython and Micropython for about a year and a half and haven't seen any issues. That being said, other than running neopixels, SPI SD cards/displays and various I2C devices I'm not really stressing the high speed timing of the microcontrollers or GPIO outputs and I'd classify both PyDOS and ljinux as not being core usage cases for Circuitpython 😁 I have built and tested on multiple development boards using the ESP32 family, nRF52840, RP2040, SAMD51, stm32L4+, mimxrt10xx microcontrollers and even the Raspberry Pi Zero bare bones. |
Just looking forward to a PR (someday post 8.0.0 😁) to implement this and I'm thinking if you define MICROPY_ENABLE_PYSTACK (0) then I would think CIRCUITPY_PYSTACK_SIZE shouldn't be allocated. If that's true, it probably doesn't hurt to leave the parameter set in case someone wants to override the setting and re-enable PYSTACK. For all of my testing I would just modify the py/circuitpy_mpconfig.h file and change "#define MICROPY_ENABLE_PYSTACK" from "(1)" to "(0)" and in py/mpconfig.h change #define MICROPY_STACKLESS" from "(0)" to "(1)". Actually, I didn't start setting the MICROPY_STACKLESS parameter until I started working with the ESP chips, on the RP2040 boards I started with, I simply disabled PYSTACK which solved my issues. |
To document a little of the discord discussion by @anecdata and @Neradoc:
I do struggle with fragmentation with my builds but can't really compare the stackless builds to the standard builds in that regard since my application doesn't really run at all unless I use a stackless build. |
I have performed A LOT more testing on On Should the recursion limit be implemented, and the exception chain get auto-trimmed, we are good. |
Now that we are using PYSTACK, investigate whether turning on
MICROPY_STACKLESS
is a significant performance improvement.From
py/mpconfig.h
:Suggested by Damien to Scott.
The text was updated successfully, but these errors were encountered: