Inspired a bit by some of the talks I saw at Pax Dev the past few days, I decided to polish up some of the performance measurements I have built in to my engine.
Previously I had a sort of generic performance measurement system set up, but it was not used in all my game’s components. The entity framework and the startup code used different mechanisms. In addition, it was hard to grok the numbers (which were simply displayed in a list).
So I addressed both these issues.
I now have hierarchical perf events, and can display child events in a bar graph relative to their parent. For instance:
It keeps track of both a running average and the maximum time an event has taken.
I unified all my game’s components to use the same performance measuring system. When I turn on the perf metrics, all the categories are listed, and I can choose from them.
It’s by no means perfect yet, but it is easily accessible when running the game, and it’s just a couple of lines to add new ones in code. Hopefully this will encourage me to tackle performance problems early.