Time lag between PreRenderComplete and SaveState
We are tracing our ASP.NET application and find that for one of our pages we see that there is a time lag of around 2.5 secs from the time PreRenderComplete Ends to SaveState Begins. Below is a part of log
aspx.page End PreRender 9.123185387 0.18开发者_高级运维4541
aspx.page Begin PreRenderComplete 9.123277718 0.000092
aspx.page End PreRenderComplete 9.123666575 0.000389
aspx.page Begin SaveState 11.77441916 2.650753
aspx.page End SaveState 11.77457158 0.000152
aspx.page Begin SaveStateComplete 11.77459695 0.000025
aspx.page End SaveStateComplete 11.77461284 0.000016
aspx.page Begin Render 11.77462541 0.000013
aspx.page End Render 15.10157813 3.326953
we are trying to understand if there is any rationale behind this. Pls help me understand this.
Thanks in Advance
According to Reflector, the only thing happening between those two events is some code that builds the control tree used with tracing output (BuildPageProfileTree). This code only runs if tracing is enabled. Here's the relevant section from the ProcessRequestMain routine for the page:
if (context.TraceIsEnabled)
{
this.Trace.Write("aspx.page", "End PreRenderComplete");
}
if (context.TraceIsEnabled)
{
this.BuildPageProfileTree(this.EnableViewState);
this.Trace.Write("aspx.page", "Begin SaveState");
}
So, ironically, the slowdown you see above is caused by the fact that you are tracing your page, and would not be there if tracing was disabled.
精彩评论