Node Statistics - turn them off?

Oct 21, 2010 at 3:44 PM

While looking over the Balder source I’ve noticed that nodes use something called NodeStatistics. These seem to be created for any type of node. I also noticed that in the method NodeRenderingService.RenderNode there is a call to node.Statistics.BeginNodeTiming()     and node.Statistics.EndNodeTiming() among other statistics calls. I also notice there are null != node.statistics around each call into this statistics object. 

My question is two part: 

1) What’s the best way to access this statistics data? I assume this could be used to get FPS and other useful information about how long something is taking to render. Great for debugging.

2) Can this be turned off to increase the render speed, in cases where I need every bit of speed I can get. It seems like tracking and maintaining these statistics could cost too much in this case. Or are they used internally in the engine and must be available?

Oct 21, 2010 at 7:44 PM


the statistics does not give FPS, only shows actual rendertime and other details for geometries and such. 

The timing part uses a StopWatch - and by default the clock is set to a NullStopWatch, so it shouldn't take up CPU cycles doing the timing. 
But, what I will be doing is to make sure that these are not included in the release version of Balder.

For now the whole timing thing is not exposed in a good API for enabling it, but to enable it you need to do the following during initialization :

Runtime.Instance.Stopwatch = new Balder.Diagnostics.Stopwatch();