We're talking about fairly anal levels of optimisation here that I wouldn't really worry about in anything other than mobile games. Let's say for example you were drawing a texture to the screen in a fairly constant position and the position of that texture could easily be calculated or stored.
I'd be interested to know what professional game developers default to in the first instance when writing code. Which of the two options below would to achieve higher performance in a majority of situations. My main development language is Java.
So option 1 is something like:
constructor {
x = container.left + offset.x;
y = container.bottom + offset.y;
}
paint {
draw(texture, x, y);
}
And option 2 is something like
paint {
draw(texture, container.left + offset.x, container.bottom + offset.y);
}
With option one the advantage is obviously that the values are pre-calculated. The disadvantages being you're using more RAM and as such there's an increased risk that the data you need wont be in the CPU cache. You also need to make sure the position is recalculated every time there's any movement.
With option two less RAM is used and therefore it's more likely data will be in the CPU cache, but there's the overhead of the calculation. We also don't need to worry about recalculation when there's movement.