views:

347

answers:

5

I have been programming in php for a while, and recently I started a new job ago where I am now programming in c#/asp.net.

While asp has decent performance when deployed, there is one thing that has been bugging me for the past few months. After any code change it takes about 30 seconds for the page to reload for testing.

I guess it is doing the JIT compiling or something. But it can be REALLY frustrating, especially if I am concentrating, and want to test out several incremental changes as quickly as possible, only to have to stare at a blank page for 30 seconds.

Does anyone have any tips to speed this process up?

+1  A: 

I feel your pain.

Personnaly I like the ASP.NET website project better for speed of developing. I don't know if you have that possibility though..

In visual studio do file->new website.

For this project type you don't need a rebuild all the time and you can just refresh a page in your browser when you have changed it. (no rebuild/debug necessary)

Julian de Wit
A: 

I've had similar experiences, it can be slow to recompile at times, but varies based on where and what code is being changed - ie if it is app_code or just page specific.

What sort of hardware are you running on? VS can be a memory hog, and anything less than 2GB seems to make it slow.

schooner
+2  A: 

In Visual studio 2005 every reference you add adds a .refresh file that makes sure the reference did not change since last time and if so brings the new version - if your references stay the same, you can just remove it!
also see here for more tips for VS 2005

Dror
A: 

I guess that can be frustrating coming from PHP. Thirty seconds sounds far too long though. Ensure the basics like free ram etc..

A couple of tips. 1. You do not have to run the debugger in order to run the site. Once you have the site up with the built in VS web server or IIS, you can make your code changes, build and just refresh the page in your browser. No need to hit play and have VS start the whole debug process. If you actually want to debug though, you don't have a choice. 2. Changes to an aspx page do not require a rebuild. I make changes and simply refresh the page to see the result instantly.

Check out the web tab in the project settings to configure how you want VS to handle serving the site. There are some options in there to hopefully help you suite it to your style. ex. I don't let VS launch a browser for me whenever I want to debug. I set the option for it to just wait for a request. Then I can just use the browser of my choice to get started.

Good luck

kareem
A: 

Our website has a very long load time due to actions which only occur during the Application Start phase (when the ASP worker process starts). In particular loading commonly used objects from a database into memory was causing a significant delay. We found that using compilation symbols to disable some features when debugging eg security and user roles, helped a lot.

bstoney