- Joined
- Jun 14, 2008
- Messages
- 191
I'm curious to know if its better to do a calculation once and save it in a variable, or calculate it out, saving you the memory.
Say you have to either calculate 20 values every 1 second using 8 variables, 200 times (one for each unit).
(so in essence 20*200=4000 possible calculations, using 8*200=1600 memory slots)
or
Calculate 5 values every 1 second using 12 variables, 200 times (one for each unit).
(so in essence 5*200=1000 possible calculations, using 12*200=2400 memory slots)
Which would be better and why?
Say you have to either calculate 20 values every 1 second using 8 variables, 200 times (one for each unit).
(so in essence 20*200=4000 possible calculations, using 8*200=1600 memory slots)
or
Calculate 5 values every 1 second using 12 variables, 200 times (one for each unit).
(so in essence 5*200=1000 possible calculations, using 12*200=2400 memory slots)
Which would be better and why?