-
Notifications
You must be signed in to change notification settings - Fork 19
Optimizing PortalBase #59
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
Comments
id like to init things more on use, because right now pyportal on esp32s2 also takes a long time to boot |
I like that idea. |
Lazy initialization is a great idea. Especially if it means that you can not copy over support modules that you aren't using. As it is now you have to have everything copied over whether you want it or not. |
Great point |
I think some of that can be handled in each of the board-specific libraries since the peripherals file does a lot of the loading. However, if you never use network functions for instance, there's no reason to load up requests, which is handled here. |
Sooo, PortalBase was never optimized. Thus it has gotten a bit bloated. It was designed with compatibility of old code in mind, and to that end it succeeded, but the library could be revamped to be smaller and more functional. I actually didn't think it would be used as heavily when I originally made a version for the MatrixPortal and then the other boards.
One of the major problems with the bloat is that it pushes many of the boards to their memory limits and I currently have a PR in place to freeze the library into CircuitPython. However, by making it smaller, this would free up some room on there.
Some of optimizing would be doing things like stripping out debug which is really unnecessary at this point and was a holdover from the original PyPortal library. Other things would be stripping out things like the "init everything at once approach" that was also a holdover from the original PyPortal library. It would mostly be writing the code to be more efficient and would likely be largely the same to the average user. I do really like the approach that was made with most of the boards in terms of adding text and would likely stick with that for the most part.
Before doing anything with this, I would like to hear other people's opinions.
The text was updated successfully, but these errors were encountered: