Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

PerformanceTest1 FPS counts (PC)

Started by TestSubject06 Jan 18, 2011 at 3:50 AM 12 replies 6k views
Original Post
TestSubject06
TestSubject06
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.
birdkingz
birdkingz
What is PerformanceTest1 ???
Seeking for Perfection
Borrillis
Borrillis

What is PerformanceTest1 ???


That's the name of the Project in the Downloads or on the CD for the project in Chapter 3 pages 35-37.
Borrillis
Borrillis
You should experience a lower FPS due to the number of iterations that loop is doing. If you change the 100000 to 0 you will see a larger framerate. Try increasing the number to 200000. This is used to illustrate to you how to measure your framerate and how the more work you do, the fewer frames you'll be able to render.
TestSubject06
TestSubject06
yeah i know, i get 5200 FPS with absolutely nothing happening, and 30FPS with the bad code in there.
Hodgman
Hodgman
Take note that comparing two FPS values is a really bad way of comparing performance.

E.g. Going from 20 to 30 FPS is an increase of 10 right... so it must be just as good as going from 30 to 40 FPS?

No:
20FPS = 50ms per frame.
30FPS = 33.3ms per frame.
40FPS = 25ms per frame.

So going from 20 to 30 FPS is actually an improvement of 16.7ms, but going from 30 to 40 FPS is only an improvement of 8.3ms.

Measure performance in milliseconds, not frames per second.
mbalrog6
mbalrog6

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.
rip-off
rip-off

yeah i know, i get 5200 FPS with absolutely nothing happening, and 30FPS with the bad code in there.

Measuring the time it takes to do nothing is generally pointless. It only sets up unrealistic performance standards. The only meaningful performance measurement is between two equivalent pieces of code, or almost equivalent (e.g. a shortcut that looks almost as good at half the cost).

As others have said, measure time to gauge performance. The only FPS that matters is the amount you get on your minimum hardware, if it meets its FPS deadline there then you're set.
NEXUSKill
NEXUSKill
Small comment on performance and optimizations, while it is generally true that if you start working already obsessed with performance and constantly thinking how to optimize everything you do, you are not likely to finish programming even a simple tetris game, some optimizations like the one shown above of removing the matrix instantiation from the loop, are simply a matter of habit, and a good habit to have for that matter.

That sort of optimization SHOULD always be kept in mind until it just becomes a part of the way you code.

Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


TestSubject06
TestSubject06
The idea behind this thread wasn't to measure performance or really go into deep optimization talk, I just wanted to know what kind of computers you guys were running. And just using a simple FPS count off of a really heavy for loop that we all had seemed like a quick and dirty route.
NEXUSKill
NEXUSKill
Oh, for that matter I'll be running mostly in a single core, 2.6 ghz CPU with 1 Mb DDR2 RAM and a GForce 7300, with XP pro SP2. Got a better computer but I use that one just for gaming
Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


JSelf
JSelf
Empty, I hit about 14400. However, with the scary loop, I get around 27. Probably still better than Crysis Max'd out!
espp1234
espp1234
I'm 110% sure that this way of measuring performance is completely useless and inconclusive. Considering what's going on under the hood, a loop that iterates 100,000 times will definitely get JIT'ed away. JIT (Just-In-Time compilation) optimizes portions of your program that are hit many times, when the JIT kicks in and how much it improves are completely unpredictable. Also, this test only takes sequential CPU computation into consideration, no new objects are created per iteration so a computer with slow RAM performs just as well as a computer with super fast RAM, which is never the case in a real game. Also, the GPU is not benchmarked either, a 2ghz laptop running an integrated card will do just as well as a quad-core 2ghz with a state-of-the-art graphics card.
JSelf
JSelf
Good points, but we were merely posting numbers

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.