• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# PerformanceTest1 FPS counts (PC)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

13 replies to this topic

### #1Zack T.  Members

Posted 17 January 2011 - 09:50 PM

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.

### #2birdkingz  Members

Posted 17 January 2011 - 11:06 PM

What is PerformanceTest1 ???
Seeking for Perfection

### #3Borrillis  Members

Posted 17 January 2011 - 11:51 PM

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.

### #4Borrillis  Members

Posted 18 January 2011 - 12:00 AM

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.

### #5Zack T.  Members

Posted 18 January 2011 - 12:33 AM

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

### #6Hodgman  Moderators

Posted 18 January 2011 - 01:16 AM

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.

### #7mbalrog6  Members

Posted 18 January 2011 - 06:11 AM

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.

### #8rip-off  Moderators

Posted 18 January 2011 - 06:37 AM

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.

### #9NEXUSKill  Members

Posted 18 January 2011 - 08:00 AM

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

### #10Zack T.  Members

Posted 18 January 2011 - 12:03 PM

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.

### #11NEXUSKill  Members

Posted 18 January 2011 - 12:09 PM

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

### #12JSelf  Members

Posted 18 January 2011 - 11:29 PM

Empty, I hit about 14400. However, with the scary loop, I get around 27. Probably still better than Crysis Max'd out!

### #13espp1234  Members

Posted 24 January 2011 - 03:28 PM

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.

### #14JSelf  Members

Posted 24 January 2011 - 03:46 PM

Good points, but we were merely posting numbers

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.