开发者

Same C# code slower in ASP.Net application versus Winforms App on same machine

We have a function in C# that uses the ICSharpCode SharpZipLib BZip2 decompression method to uncompress some XML we get from a database. We have noticed an issue on two of our webservers (Win 2K and Win 2003 Svr) that this code takes a really long time to execute and causes the CPU utilization to max out on these servers. We have isolated the code and put it into a Winforms app for testing and when running this same code in the winforms app on the same machines the code runs much faster. This is with the same SharpZipLib assembly.

So far we are at a loss as to why开发者_JS百科 the code runs so much slower under the asp.net process.

Any suggestions, ideas ?

Thanks in advance!


Use a profiler. Problem might be somewhere outside of the decrompession code. You, I and the rest of the folks at SO won't give any more info than one profiler session will give.


Have you tried watching the code in a Profiler like RedGate ANTS Performance Profiler to see what kind of things the code is doing?

Code hosted inside of an ASP.NET application is run under completely different conditions than a WinForm application. You could be running into ThreadPool issues when loading through the IIS worker process.

You could also be running into an issue where your code is not pre-compiled in your ASP.NET application.

All that being said, running your application through a Profiler is going to provide you with the best view into how things are working.


Make sure you are creating a web project and compile it for release build. (Build -> configuration manager)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜