开发者

Javascript slow when Upgrading from .NET 2.0 to .NET 3.5

I would like to move our solution to .NET 3.5 and VS 2008. We are still on VS 2005 and 2.0. Some tools we would like to use are phasing out 2.0 and 2005 support, so I thought I'd test our solution after upgrading to 3.5.

I converted the project in VS 2008. I fixed some compile errors that popped up, and then fixed up some javascript name change that occured involving the AjaxToolkit.

Everything looked ok, but when I came to a particular page that is quite heavy with validators and javascript...the page slowed to a crawl on loading.

I used the IE 7 javascript profiler, and saw some completely crazy numbers in the .NET javascript methods. I don't know what is going on.

Has anyone run into the problem? Do I having something misconfigured.

I'm including below 2 profiles. One captured when running in .NET 2.0. Another when running on .NET 3.5. At this point, I can't even consider 3.5, if I can not solve this problem.

2.0 Profile

https://spreadsheets.google.com/spreadsheet/ccc?key=0AvxeS-OgIIkCdERSYVprOTRXZ2lkaFpqMkFFSkkxMXc&hl=en_US&authkey=CKKB5t0I

3.5 Profile

https://spreadsheets.google.com/spreadsheet/ccc?key=0AvxeS-OgIIkCdGhHdVJRS0FWcEp4azN0SHkxNWF5eUE&hl=en_US&authkey=CNHyu6cG

Please help...this is crazy.

Thanks, Rich

---Update

Omar, I did as you suggested and set debug=false in the web.config file. This solved the problem. I put timing code in the page's javascript, and the javascript went from taking 17-18 seconds, back down to ~5 seconds. This is around the same time the page takes in .NET 2.0, so I'm satisfie开发者_JAVA百科d with that (though, would love for IE to run this code faster).

My only problem now is that, I obviously run the solution with debug=true during development. This is a serious hit to my productivity, as this page is used quite frequently. I'm guessing the new javascript debugging abilities introduced in VS 2008 are responsible for all this. When debug=true, I'm guessing a debug build of the .NET javascript libraries are used.

Does anyone have any advice for work-around? Thanks - Rich


It seems you have some script in script blocks that are causing problem. Can you nail down which scripts and show? You should turn off compilation debug=false in web.config and measure the time. if that's also very slow, we have some problem in your script code. May be you are using some code in ajax libraries that need to be changed. Maybe missing some required field, thus causing too many validation errors.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜