Replies: 1 comment 1 reply
-
Almost certainly! MicroPython does have some additional constraints that make some of the ideas more difficult. For example the Specialising Adaptive Interpreter (https://peps.python.org/pep-0659/) is difficult because in many situations MicroPython bytecode is immutable (because it's executing from ROM). Some history: MicroPython did have a bytecode-mutating optimisation for optimising map lookups, that made instructions like LOAD_ADDR and LOAD_GLOBAL much faster. But this was basically never able to be enabled except on Unix. I believe CPython subsequently implemented something similar (this predates faster-cpython though). We subsequently removed and implemented with a separate cache for almost the same overall benefit, but supported and enabled on all targets. Mutating the bytecode is faster, but just wasn't an option. Many faster-cpython ideas are also around improving memory usage (which is faster on its own, but also reduces GC pressure). MicroPython obviously already takes this to pretty extreme levels (to the opposite end of the spectrum where it deliberately does things in slower ways to use even less RAM). There's definitely some stuff worth exploring around exceptions and stack frames, I know faster-cpython is investigating this too. Damien did a bunch of work on this previously see the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been following faster-cpython repository since python 3.10 was released. They are trying to make CPython faster and have already achieved some exciting results. CPython3.11 is about 25% faster than CPython3.10. Can MicroPython benefits from these ideas to increase its performance?
Beta Was this translation helpful? Give feedback.
All reactions