Last post May 15, 2012 10:04 PM by Decker Dong - MSFT
May 14, 2012 12:13 PM|lPerf|LINK
I am having a slow response while uploading a XML file into a server. My file is dynamic, with a very simple structure and consist only of ID's that I am sending from the client side to the server side. Once the data is on the server side, there is an engine
that reads the ids and do some manipulation to those records. I tested first sending a variable with my ID's to the server and then on the server side did a:
to retrieve the values.
That worked well except that the number of id's can grow to up to 100K which means that the string would get rather big. I don't think that it's efficient to handle strings with large number of characters; so I decided to go for the XML file (correct me if I am worng though). In any case, even if I send just one id in the XML file, it takes some time to complete the transaction. I already checked all the parts where my code runs and they all do so in low milliseconds but once it hits these lines in the server side:
Stream s = this.Context.Request.InputStream
XDocument doc = XDocument.Load(s);
it stays there for up to 15-20 seconds uploading the file even when sending only ONE id. So it is not acceptable for the clients.
Any suggestions? What should I be looking into? I already thought about the network; but that is not it. We have some other applications working on this network and they are responsive. So, that is not it.
May 15, 2012 10:04 PM|Decker Dong - MSFT|LINK
In this situation I think because you have quite a lot of things to read out，So maybe your main Thread will be hung up……And the only solution in my mind is that you can define a delegate such as Action and then use the async control to deal with that：
Action a = new Action(
//Here use XmlDocument to read out things……
//Show the result to finish the task……