-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
CircuitPython version and board name
Any version
Code/REPL
example:
import adafruit_fruitjam
vs
from adafruit_fruitjam import peripherals
Behavior
I was asked to post this issue for CircuitPython core developers by @ladyada.
In the Adafruit Learning System Guide Memory-saving tips for CircuitPython
https://learn.adafruit.com/Memory-saving-tips-for-CircuitPython/optimizing-memory-use
By selectively importing only the functions you need, you may be able to reduce your memory usage versus importing a whole library. Each CircuitPython library is organized differently, so the impact of this technique will vary. Measure the memory use of the import to see how much memory is saved by using selective imports.
This behavior, per the feedback received is disputed allegedly by a Python core dev referenced in a stack overflow post: https://stackoverflow.com/questions/31691188/does-the-number-of-imported-modules-in-python-effect-memory-and-performance/31691438#31691438.
Ladyada has asked that the devs verify whether selective import from a module does indeed save memory or not and advise so that the guide may be updated accordingly.
Thank you for your time.
Description
No response
Additional information
No response