Paul Liebrand’s Weblog

Welcome to my blog mainly about SharePoint

SharePoint Development to BIN folder and extremely slow initial render times – Solution!

My fellow co-workers and I have been dealing with an extremely slow build > render process when we are developing SharePoint solutions that are deployed to the BIN folder for over a year now.

We are all using are own Windows Server 2003 image hosted on a VMware ESX Server farm with tons of other VM’s.

We all know that SharePoint can take anywhere from 30 seconds to 2 minutes to fire up the very first time you hit it and we accept that fact. However, we found ourselves waiting for up to 1 minute after making some code changes and perform a build that deployed the DLL to the BIN folder for SharePoint to render.

This can become extremely frustrating and frankly a waste of our time. I had gotten to a point where I just accepted the fact we had to deal with the slowness because no amount of tweaking we did on the VM (adding memory, CPU, etc) seemed to make a difference.

One of my co-workers did not want to accept the fact continued to investigate/troubleshoot the issue. He happened to come across the Understanding ASP.NET Dynamic Compilation (http://msdn.microsoft.com/en-us/library/ms366723.aspx) article, more specifically the section called Optimizing Dynamic Compilation. This section mentions an attribute you can add to your web.config file called optimizeCompilations which requires you to install a hot fix (KB961884). This attribute is going to be part of the .NET Framework 4.0 when it ships.

We were all amazed at the difference this attribute made to our development process. In one instance, it cut the time from 1 minute 10 seconds to 12 seconds (80% improvement!!).

The following screenshot shows the change in time with the attribute set to false and then set to true (fairly vanilla SharePoint application). The WebTimer utility just makes a simple web request to my SharePoint site.

OptimizeCompilation

Here is the order events described above:

  1. optimzedCompilations attribute in web.config was set to “false”
  2. Performed IISRESET to baseline
  3. Executed WebTimer (40 seconds)
  4. Modified some code in my solution and performed a build (which went into the BIN folder)
  5. Executed WebTimer (30 seconds)
  6. Switched optimizedCompilations to “true”
  7. Performed IISRESET to baseline
  8. Executed WebTimer (40 seconds)
  9. Modified some code in my solution and performed a build
  10. Executed WebTimer (12 seconds)

Needless to say, we have happy developers again! 

You may or may not see much advantage to this if you are developing on a physical machine or on a workstation edition of a virtual client (VPC, VMware Workstation, or Virtual Box). But if you are running in an environment where the resources are being shared or you feel your build to render process seems slower than it should be, I highly recommend you try this hot fix / attribute out.

Advertisements

September 18, 2009 Posted by | SharePoint | , , | 2 Comments

SharePoint URL Shortener – Feature Highlight

There is a feature in my SharePoint URL Shortener solution that was not included in the video I posted on YouTube recently. I thought I would take the time to spotlight this feature because it may not be too obvious.

The video highlights the ability to generate a short URL by using the drop down menu from within a list or library, for example:

ShortUrlLibrary

However, sometimes you may have the need to shorten the current URL you are on within a SharePoint site (it does not have to be a list item or document). My SharePoint URL Shortener adds a link to the Welcome menu located in the top right corner of the screen that when clicked will generate a short version of whatever URL you are currently viewing.

Lets say you wanted to create a survey and send it out to your users. You can now click on the Respond to this Survey button:

ResponseSurvey

Which will take you to some awful long URL which you would generally copy and paste into an email, or a SharePoint announcement and send out to your users.

With SharePoint URL Shortener, you can now click the drop down on the Welcome menu and select Generate Short URL and it will generate the short URL version:

WelcomeMenu

You can now include this shortened URL in an email message or post it to an announcement list within SharePoint.

ShortURLEmail

I hope you find this useful.

Thank you

September 1, 2009 Posted by | SharePoint | , , , | 1 Comment