True, in practice there are some things that you can anticipate optimizing. However, there <i>is</i> such a thing as doing too much, before you know that there&#x27;s a performance problem.<p>Another good graphics&#x2F;physics example is that you don&#x27;t have to take the square root in a distance computation if you only care about the monotonically increasing ordering and not the exact distance. If you know that you will be dividing by magnitude or distance frequently, another optimization is to store the inverse of the magnitude instead of the original magnitude. That issue sometimes shows up in inner loops.<p>But optimizations like that also don&#x27;t have to be done up front because refactoring that kind of thing is relatively straightforward compared to switching out the underlying data structure or algorithm.<p>My rule of thumb is that if I know I&#x27;m writing an inner loop, then I will bake in whatever best practices I already know about. Otherwise I&#x27;m going to write the feature first with generally sane architectural choices, and profile it later.