Dealing with performance while developing on local machine

Keith Donnell asked on September 3, 2015 23:16

I am curious how other developers develop custom web parts, modules, etc on their personal machines. Now that I'm getting into actual development, I'm noticing the following trend: Write a few lines of code. Build. Wait 5 minutes for site to warm up. Test. Write a few more lines of code. Build. Wait 5 minutes.

It seems much (or even most) of my time is spent waiting for the site to warm up after an app restart, which occurs after every build. I wish I could build a console app to do some test-driven development, but that's not something I can really take advantage of with Kentico, especially when dealing with user controls. Any hints/tips/tricks from the long-time Kentico developers out there?

Recent Answers

Brenden Kehren answered on September 3, 2015 23:30 (last edited on September 3, 2015 23:31)

There's no need to rebuild each time you make code changes, if you're using a website. If you're using a web application, it will need to be rebuilt in order to debug properly. Also note when you make changes to any piece of code in the /App_Code directory or the web.config file, the site will rebuild automatically. So if you stay out of those areas, you'll also be fine. If you're using a web application/project, things will build a lot faster but you also have to deploy the whole site when you make a simple change.

You can make a few setting changes to your website so it doesn't do this each time. Kentico MVP, Brian McKeiver has a blog post about this

Also if you have the ability to upgrade your machine, go with a SSD vs. a traditional spindle drive, you'll notice improvements hand over fist.

0 votesVote for this answer Mark as a Correct answer

Laura Frese answered on September 4, 2015 00:10

In case you aren't already, it helps me a lot to write to Kentico's Event log to debug. More info on how to do that here: Working with the system event log and Designing secure error messages

0 votesVote for this answer Mark as a Correct answer

Bryan Soltis answered on September 4, 2015 14:13

The "warm up" is actually due to the Visual Studio compiler and how it handles the website project type. Basically, Microsoft has not updated this compiler and it's not optimized to handle the project structure the way it is a web application. Brian's blog is a definite help and can get you up and going in a few seconds when you need to debug. Just be sure to change your settings back when you are doing a full site test.

0 votesVote for this answer Mark as a Correct answer

Jeroen Fürst answered on September 4, 2015 15:50

Use the web application project type powered by Roslyn ( Our devs have SSD's which also speeds up the build time. Usually takes less then a minute to get it back up and running :)

0 votesVote for this answer Mark as a Correct answer

Keith Donnell answered on September 9, 2015 22:56

Thank you for all of your suggestions.

We already use the web application project. The build time is a few seconds on my machine. The issue is that the home page takes a couple minutes to load, and every module I load in the dashboard takes a couple minutes (each) the first time I load it (once cached, everything loads in a reasonable amount of time).

Unfortunately, the suggestions above seem to aim at improving compilation speed, not initial runtime speed. The promising answer (Roslyn compiler/VS2015) comes explicitly without guarantee - Anyone have an enterprise-level website running with the upgraded project having any issues?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.