XBox:Hardware:GameComponents
From MadoxLabs
|
Edit Downloads:XBox (http://madox.ca/mediawiki2/index.php?title=Template:Downloads:XBox&action=edit)
|
I have been using GameComponent for all the parts of my framework, but on the XBox I am seeing this from my timing data:
Thread 0 - Dumping frame stats:
Frames 998
Average Frame time 16.69 ms
Idle: 42.46 percent - Avg 7.09
PlayerManager Update: 10.47 percent - Avg 1.75
Unknown time: 17.68 percent - Avg 2.94
SkinManager Update: 5.95 percent - Avg 0.99
Update FPS: 7.04 percent - Avg 1.17
Update Camera: 0.06 percent - Avg 0.01
Update Trees: 1.94 percent - Avg 0.32
SkinManager Draw: 0.63 percent - Avg 0.11
UI Wait on Widgets: 0.24 percent - Avg 0.04
UI Upload: 0.69 percent - Avg 0.12
UI Render: 0.54 percent - Avg 0.09
Camera prep: 0.18 percent - Avg 0.03
Instancing prep: 0.14 percent - Avg 0.02
Shadow map: 2.43 percent - Avg 0.40
Main Scene: 8.02 percent - Avg 1.34
On the average, 18% or 3 ms per frame is being wasted due to some unknown period of time. I diligently mark all the exit points of my functions as 'Unknown time' because I know the frame is still going on, its just not running through any of my own code.
The total time here adds up to ~98% so the timing seems accurate enough. What is this wasted time? Well, I refined my timing message and saw this:
Thread 0 - Dumping frame stats:
Frames 998
Average Frame time 16.69 ms
Idle: 42.46 percent - Avg 7.09
PlayerManager Update: 10.47 percent - Avg 1.75
Unknown time - exit player update: 9.25 percent - Avg 1.54
SkinManager Update: 5.95 percent - Avg 0.99
Unknown time - exit skin update: 6.25 percent - Avg 1.04
Update FPS: 7.04 percent - Avg 1.17
Update Camera: 0.06 percent - Avg 0.01
Update Trees: 1.94 percent - Avg 0.32
Unknown time - exit updatemain: 1.18 percent - Avg 0.20
SkinManager Draw: 0.63 percent - Avg 0.11
Unknown time - exit skin draw: 0.39 percent - Avg 0.06
UI Wait on Widgets: 0.24 percent - Avg 0.04
UI Upload: 0.69 percent - Avg 0.12
UI Render: 0.54 percent - Avg 0.09
Unknown time - exit ui render: 0.08 percent - Avg 0.01
Camera prep: 0.18 percent - Avg 0.03
Instancing prep: 0.14 percent - Avg 0.02
Shadow map: 2.43 percent - Avg 0.40
Main Scene: 8.02 percent - Avg 1.34
Unknown time - exit rendermain: 0.53 percent - Avg 0.09
All of the large 'unknown times' is when XNA is switching from one GameComponant to another. (You don't know my code so take my word for it). This tells me that using game componants for the sake of proper XNA best practice is a lot of bunk. I'm going to switch to non-GameComponants and hope that I see that time reclaimed.
Since this post, I updated to XNA 4.0 and the speed improvement are gigantic. Not having GameComponant still seems a bit faster than using GameComponant but since overall XNA4 is so much better, its really just a style choice at this point.