Just out of curiosity, what were you guys' FPS counts for the PerformanceTest1 PC project
(The one with
Matrix m = Matrix.Identity;
Vector3 v2;
for (int i = 0; i < 100000; i++)
{
m = Matrix.CreateRotationX(MathHelper.PiOver4);
m *= Matrix.CreateTranslation(new Vector3(5.0f));
Vector3 v = m.Translation - Vector3.One;
v2 = v + Vector3.One;
}
In it)?
I got 30 FPS, and while playable - its still pretty bad.
I think that is the point of this code to illistrate how the code will effect the FPS.
There are some glaring issues with this code that probably should be pointed out.
Inside the loop we are creating an instance of a Matrix and initializing it with a value that does not change on every pass...
Matrix.CreateRotationX(MathHelper.PiOver4);
Matrix.CreateTranslation(new Vector3(5.0f));
these can actually be factored out of the loop and make a dramatic improvement on FPS.
That is the point to watch for those kind of optimization, but as the book states you don't have to make that optimization till you notice it actually impact your game.