AltmodeFriend icon indicating copy to clipboard operation
AltmodeFriend copied to clipboard

[cleanup] change register bits to consts

Open erik-smit opened this issue 2 years ago • 1 comments

what do you think about this?

erik-smit avatar Dec 16 '23 11:12 erik-smit

FWIW, reading https://docs.micropython.org/en/latest/reference/constrained.html#compilation-phase prompted me to be curious about the memory usage of these changes.

And prefixing with a _ to allow inlining saves a bit of this increase.

Memory usage of previous 'simple' constants: GC: total: 192064, used: 45984, free: 146080

Memory usage of 'improved' constants: GC: total: 192064, used: 53856, free: 138208

Memory usage of these underscored constants: GC: total: 192064, used: 49712, free: 142352

erik-smit avatar Dec 23 '23 20:12 erik-smit