Wish to optimise your C# code? I have made a compatibility layer for the Tracy profiler. This is crucial for any #indiedev optimising their game.
https://github.com/AugsEU/TracyWrapper
You can implement this in your C# projects today. Follow the 3 easy steps below ⬇️⬇️
https://github.com/AugsEU/TracyWrapper
You can implement this in your C# projects today. Follow the 3 easy steps below ⬇️⬇️
Comments
Simply call the InitThread function on any thread you wish to initialise for profiling.
protected override void Initialize()
{
TracyWrapper.Profiler.InitThread();
/* Init logic */
}
For videogames, you can tell tracy where each frame ends with the heartbeat function
protected override void Draw(GameTime gameTime)
{
/* Game logic goes here */
TracyWrapper.Profiler.HeartBeat();
}
Define zones for the profiler to time, using the Push/Pop API.
public void Update(GameTime gameTime)
{
Profiler.PushProfileZone("Physics update", ZoneC.BLUE_VIOLET);
/* Physics update. */
Profiler.PopProfileZone();
}
I did it on my game, who knew that the drawing would take longer than the update? Time to look into that.