Any existing in-game MonogGame/XNA performance stats / diagnostics info?

192 Views Asked by At

I'm in the process of creating a game using MonoGame and a fork-of-a-fork of Farseer Physics (https://github.com/alundgren04/Aether.Physics2D) and trying to push the physics to be able to process a very large world. In doing so, the on-screen statistics are invaluable: https://github.com/alundgren04/Aether.Physics2D

Many of these came with the physics engine, and others I had to add. I'm wondering if there's something similar for MonoGame. Something which would show each frame how many polygons were rendered, how many sprites, etc., and how long each took. This would be analogous to the physics info where it lists both the number of "Bodies," "Fixtures," "Joints," etc., and the time it took to up date each of them. See screen grab here: https://i.stack.imgur.com/Lq6bO.png

I see the total physics update time is around 3-5ms yet the game only appears to be rendering perhaps once a second or so (1 fps). This points to the rendering being the bottleneck in performance, and I would like to have thorough diagnostics before beginning the optimization effort. I could build it myself, and may end up doing so, but I'm hoping there's a built-in solution I can at least use as a foundation.

Thanks!

1

There are 1 best solutions below

0
On

GraphicsDevice.Metrics returns rendering information when you draw. It's reset whenever Present is called. While it doesn't mention how long everything took, it still contains information that should help with debugging your issue.