Judging by the correctness / incorrectness of the statistics, we will rely on an understanding of what it measures.
Digging into Sitecore.Diagnostics.Statistics using Reflector I note the following:
- Sitecore.Web.UI.Webcontrol contains the m_timer field
- This is โstartedโ in the BeforeRender () method and โstoppedโ in the AfterRender () method
- Data from this timer is sent to Statistics.AddRenderingData () and registered in the control.
This means that it measures the time it takes to render the control, which for XSLT includes the processing time to prepare all the data in it, but most of the work of regular ASCX is done before the Render phase, statistics are much less useful. Including the loading phase during unintentionally includes processing time for all child components, since the loading sequence is bound and called recursively, so it probably doesn't help either.
I suspect that there is no good way to measure processing time for a specific ASCX control (excluding children) without first receiving cumulative data, and then processing the call chain and dividing the time. This is what RedGate ANTS is really good at, but it might not be so good if it runs on a live production system, given the overhead.
source share