Open peterhinch opened 1 week ago
This looks like a clear approach.
Once I have some more time I can investigate this refactoring issue.
I am happy to do the refactoring of __init__.py
- I have quite a lot of experience with MP coding. The main issues are object names and cacheing of variables. The video will clarify the reasoning.
Talk next week :)
@bobveringa I hope you had an enjoyable break.
I have given some thought to the changes on the
read_allocate
branch. I think, once you've ironed out any issues in your application, these should be merged. These are the main considerations.._as_read
substantially reduces allocations.memoryview
can cause concurrency bugs if a callback launches tasks.__init__.py
.Re refactoring, I suggest you watch this short video by Damien George on MicroPython optimisation. This will explain why MicroPython code tends to differ from "big iron" Python, notably in object naming. My main concern is
__init__.py
because of the use of V3.1.1 on ESP8266, which is extremely RAM-constrained. You might also want to consider these issues inmqtt_v5_properties.py
.Like all optimistion, this may be done late, once we have a solution that meets your needs.