Saturday, 26 November 2011

Performance Testing

I have finally managed to draw something to the screen using DX11 (Actually DX10 because my system doesn't support 11 but it should still work fine). Anyway, I managed to draw the first triangle (harder than you would think). And I have implemented a timer to count frames per second as accurately as possible so I can easily monitor and adjust code to improve performance where I think it should be. Anyway, here's a lil' pic for you:


As you can see the current display of the triangle is drawn in ~330μs. This is a good start. I wanted to know more or less how much overhead came with the 'draw' call to the graphics card. So I added a loop to the draw code which would draw the same triangle, in the same position 'x' number of times per frame, the code looked a bit like this:

Clear screen red

draw triangle 'x' times

Show image on screen

After doing testing on this, it seemed that with x less than 10, about 330μs is to be expected. For 100 draw calls about 400μs which is good because this is the expect number of draw calls in the final game. For 400 draw calls about 500μs is the result. I will not be comparing these to XNA for two reasons, 1) I'm a tad lazy and 2) This system is fast, and is certainly going to be faster than XNA so I will be using it, without a doubt.
I am sure that with a system that is capable of utilizing full DirectX 11 these numbers would improve but when you think about it, 400μs is tiny, thats 0.4ms which is 0.0004s, so even when the rendering system has to fall back to DX11 emulating DX10 or DX10.1 there should still be no performance issues.

If at all possible, could you leave a comment or let me know the basics of the systems you are running so that I can get a good idea of how well this game will run across all interested people. Thanks.

No comments:

Post a Comment