Memory optimization in the code #461
Replies: 3 comments
-
Posted at 2015-10-13 by @gfwilliams Yes, you can do that - but it won't save you a great deal of memory (only a few variables)... While the You can check how much memory you are using before and after the delete using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-13 by @allObjects Since you - @francesco - use objects that creates a namespace for methods, you can chose shorter method names, such as sR(), sG(), ...and sC(r,g,b) - for setting a particular or continues color and that will save you probably more space than deleting the constructor (source)... assumed your overall code will not be shrink wrapped (bulked and minified). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-14 by Francesco thanks both for the reply, I have solved in other way that I'll explain: For my partcular case the core of the software is a function called at regular intervals, and I choose at boot time what function run (I have defined N function, one for each "mode").
before the chosen function is called |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-10-13 by Francesco
Hi,
I have wrote a software which uses a lot of object instantiated only at the boot.
I need to save memory and delete unused data.
for example, this code allow me to instantiate more objects each assigned to a multicolor LED:
The question is: Can I safely delete the TRILED object after their initialization? Can safely call the method set* and reset in the future ?
It seems to works but I need a confirmation, I want to do this:
Beta Was this translation helpful? Give feedback.
All reactions