Frozen Byte Code
Frozen Byte Code
Pull request 2067, which allows to store modules with frozen byte code into Flash, seems to work well. It would be very helpfule for all people fiighting with memory error during import to officially commit to PR. For trial, you could simply apply the changes to Makefile and mpconfigport.h manually, but it's more convenient to have that in the standard branch.
Re: Frozen Byte Code
You can create branches for PRs by doing the following:
The pr-2067 portion is arbitrary and you can use any name you like for the branch name.
This also assumes that "origin" is the remote for the micropython repository (some people make origin point to their own fork of the repository and use a different name for the micropython one).
Code: Select all
git fetch origin pull/2067/head:pr-2067
get checkout pr-2067
This also assumes that "origin" is the remote for the micropython repository (some people make origin point to their own fork of the repository and use a different name for the micropython one).
Re: Frozen Byte Code
a little new to this still... what is 'frozen byte code' - or is there a good resource for me to read up on it? I am having some issues importing modules so I'd appreciate it.
Thanks
Jon
Thanks
Jon
Re: Frozen Byte Code
The normal process is that the python code is read into RAM, compiled into bytecode in RAM and executed from RAM.
Frozen python code, is python source code that is stored in flash (instead of RAM).
Frozen bytecode is python source code that has been compiled (on a host computer) and stored into flash.
So frozen bytecode doesn't consume RAM to store the bytecode.
Frozen python code, is python source code that is stored in flash (instead of RAM).
Frozen bytecode is python source code that has been compiled (on a host computer) and stored into flash.
So frozen bytecode doesn't consume RAM to store the bytecode.
Re: Frozen Byte Code
Hi Dave,
I know how to deal with that PR, but I think it's an useful feature for all of us, so it's worth to be included in the master branch. like it is on Pyboard, especially since many posters hit the 'memory wall'.
And one should mention, that frozen byte code like pre-compiled byte code also helps when running out of memory during import. Surely, the code handling and testing less comfortable, but at least you can run your programs.
I know how to deal with that PR, but I think it's an useful feature for all of us, so it's worth to be included in the master branch. like it is on Pyboard, especially since many posters hit the 'memory wall'.
And one should mention, that frozen byte code like pre-compiled byte code also helps when running out of memory during import. Surely, the code handling and testing less comfortable, but at least you can run your programs.