I am working on a project that is using MicroPython. The project uses frozen bytecode to create binaries that can be deployed to devices. Recently, I have been looking at using bytecode optimization that should be supported by mpy-cross https://docs.micropython.org/en/latest/ ... .opt_level. However, I have been unable to get this to work.
I have found this issue https://github.com/micropython/micropython/issues/5392 which provided some helpful information but did not help in finding a way to enable it.
I am using MicroPython on an ESP32, so when looking through the esp32 port I found the mpy-cross flags in the CMakeLists.txt
https://github.com/micropython/micropyt ... s.txt#L167
I changed
Code: Select all
# Define mpy-cross flags, for use with frozen code.
set(MICROPY_CROSS_FLAGS -march=xtensawin)
Code: Select all
# Define mpy-cross flags, for use with frozen code.
set(MICROPY_CROSS_FLAGS "-march=xtensawin -O3")
Code: Select all
import micropython
print(micropython.opt_level())
I validated that changing the flags actually does something by changing the "-O3" to "-h" and during the build process a help message is displayed.
My question is, where do I need to make the modification to be able to set the opt_level?
It feels like I am missing something obvious, but I have looked around for a while and haven't found anything. Any help or tips in what direction to look are much appreciated.