Closed fivesixzero closed 2 years ago
The commit in this PR has been included with #38 which is currently in draft status.
I'm leaving it open for now since its ready for merge and is a lot less work to review for merge than that the large refactor in the other PR.
I also included the commit in this PR within #39, which has superseded #38.
Since that one is so big I'll leave this as a seprate PR in case some or all of the changes that PR don't work out.
While preparing some potential fixes for review I realized that most prospective fixes will increase memory usage a bit.
After some discussions in the
circuitpython-dev
Discord channel with danh I tried applying leading-underscore naming to the slew of purely internal constants in the main driver file.To see if this actually made a difference, I did some basic memory usage testing using a script I quickly put together. Its definitely not scientific - there are a bunch of other things that could be impacting memory usage - but at the very least it should provide some rough indication of whether this fix is worth the effort of submitting a PR. š
The table below shows the increase in memory usage from tests with four different versions of the library.
mpy
size20211114
mpyThe compiled file size dropped by more than 10%, which could be handy on some more limited boards. The memory usage savings weren't as strong but a 5% memory footprint reduction for just adding some underscores ain't bad.