mohaaron
2006-04-26 02:41:30 AM

Can anyone tell me why when trying to use the following code to
deserialize the viewstate it takes a long time with a large viewstate.
This really surprised as the viewstate is big, but not that big. The
formatter.Deserialize method takes a couple seconds which is a long
time.

protected override object LoadPageStateFromPersistenceMedium()
{
object viewState;
string tempViewState;
tempViewState = (string)this.Cache["ViewState"];
LosFormatter formatter = new LosFormatter();
try
{
viewState = formatter.Deserialize(tempViewState);
}
catch(Exception x)
{
throw new HttpException ("Invalid viewstate:" + x.ToString());
}
return viewState;
}

 

Re: Save ViewState to server - deserialize is very slow

=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
2006-04-26 03:37:00 AM

What are you storing in there, and what is the goal? Here's an article,
which also references some excellent work by Robert Boedigheimer, that covers
all this:

www.eggheadcafe.com/articles/20040613.asp

Peter



Co-founder, Eggheadcafe.com developer portal:
www.eggheadcafe.com
UnBlog:
petesbloggerama.blogspot.com




"mohaaron@gmail.com" wrote:

>Can anyone tell me why when trying to use the following code to
>deserialize the viewstate it takes a long time with a large viewstate.
>This really surprised as the viewstate is big, but not that big. The
>formatter.Deserialize method takes a couple seconds which is a long
>time.
>
>protected override object LoadPageStateFromPersistenceMedium()
>{
>object viewState;
>string tempViewState;
>tempViewState = (string)this.Cache["ViewState"];
>LosFormatter formatter = new LosFormatter();
>try
>{
>viewState = formatter.Deserialize(tempViewState);
>}
>catch(Exception x)
>{
>throw new HttpException ("Invalid viewstate:" + x.ToString());
>}
>return viewState;
>}
>
>
 



Re: Save ViewState to server - deserialize is very slow

mohaaron
2006-04-26 04:46:00 AM

Peter,

Thanks for the reply. I have seen this article and currently have my
solution working in a similer way. I am still wondering why the
Deserialize method is soo slow with a large viewstate. I would expect
that this would be handled a lot better.