Skip to content
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

MicroPython: Revert to vanilla module, build without MPY hacks. #84

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Gadgetoid
Copy link
Member

While running some tests my figures seemed to suggest that not only is using builtins unnecessary for PicoSystem but somehow results in it being slower.

This change reverts back to a plain MicroPython C++ module and is intended to build against a mostly vanilla upstream MicroPython.

Mostly.

It still needs:

  1. Overclock
  2. Overvolt
  3. Smaller gc_heap allocation
  4. A custom board config

@Gadgetoid
Copy link
Member Author

Gadgetoid commented Sep 28, 2022

I have introduced a new hack into boot.py which imports picosystem's contents into the builtins module namespace, making them globally available without having to explicitly from picosystem import * at the top of every .py file.

It works. But it's slower. I think?

My isolated tests suggest this should have been faster, and some clarification about how function lookups happen seem to confirm this. But Ninja Thief runs perceptibly slower.

The question, perhaps, since this relies on fewer hacks to upstream MicroPython and is building against a bleeding-edge version (should easily bump to 1.20 when release happens) then is it slow enough to warrant leaving it to rot in PR purgatory, or should we take the hit and move on?

@Gadgetoid Gadgetoid force-pushed the revert-builtin branch 8 times, most recently from fad7412 to 3f90b88 Compare March 14, 2023 21:33
Borrows the build setup from Badger OS which-

* Uses a uf2-manifest and dir2uf2 to append examples in a user-visible filesystem
* Uses MICROPY_BOARD_DIR to specify an out-of-tree board def
* Uses ccache and caches MicroPython (compiled tools)
* Builds against upstream MicroPython
@Gadgetoid Gadgetoid force-pushed the revert-builtin branch 8 times, most recently from 4c93c86 to f03ce0e Compare March 15, 2023 12:47
* Use string_view in lieu of string
* Rewrite _parse_escape_code to be compatible with string_view
* Allocate a static buffer_t _SCREEN if DYNAMIC_BUFFER not set
@Gadgetoid Gadgetoid force-pushed the revert-builtin branch 2 times, most recently from dfb6486 to d5a56db Compare March 15, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant