The Importance of Incremental Builds

by Donn Felker 15. October 2008 03:41

With continuous integration being integrated into Team Foundation Server 2008 we can sometimes run into unexpected results. Such as extended build times.  By default the build file is set up to inform the TFS Build Agent that it should perform a "Full Build".

What is a "Full Build"?

By default, when TFS performs a build the following events happen:

  1. Clean - When Team Foundation Build performs a full build, it cleans the files in the intermediate build folder and sources folder in Clean target.
  2. Workspace Initialization - As a part of a full build, Team Foundation Build deletes the old, and recreates a new workspace to clean and synchronize the source files.
  3. Get - In the Get task, Team Foundation Build by default retrieves new source files and overwrites the existing files in the build workspace.

 

A Possible Issue

slow A full build can have consequences that can be considered "non-optimal" (this is very subjective in many circles), but in my opinion coming from a Cruise Control .NET background, I DO NOT want full builds.

If my source code repository is very large, cleaning the files, re-creating the workspace and then getting all the files again can be a real pain in the "time" category. I've had builds on my local dev machine (which is in a VPC) take 15-20 seconds to build using Visual Studio. I've even run the same build from the command line using MSBuild using the .proj file and its taken less than 15 seconds for he same build (~15 Visual Studio Projects in the solution).

However, this same build using TFS would take nearly 20+ minutes!

Wowzers... The reason the build took so long in TFS is because it was utilizing the FULL Build.

 

 

 

 

Core Concept

One of the core concepts is "Keep The Build Fast". We're looking for frequent feedback. 20 minutes (IMO) is not quick feedback (if the build takes 15-20 seconds on my machine). We should be able to get this down to under 10 minutes at the worst, but my goal is to get it well under 5 minutes (closer to 2 minutes).

 

Enabling TFS 2008 Incremental Builds

In Team Foundation Server 2008, we can change this behavior with a simple change in the TfsBuild.proj file under the TeamBuildTypes directory in TFS. Here's how:

  1. Open the TfsBuild.proj file for the build in question
  2. Add the following XML:

image

This will enable Team Build to treat this build as an incremental build.

What does this exactly do behind the scenes?

IncrementalBuild is a convenience property that sets SkipClean to true, SkipInitializeWorkspace to true, and ForceGet to false.

Since clean is skipped, the files will not be deleted. Since SkipInitailizeWorkspace is skipped, the workspace will not be deleted and recreated and since ForceGet is disabled, the files will not be overwritten with the files from Source Control. What this will do is perform a regular "Get" on the existing workspace which will only get the changed files.

 

Result

A huge performance improvement. The previous ~20 minute build dropped to about 4 minutes. There are some other improvements I could do to improve the performance,but at this time its 5 times as fast. Excellent. :) Why did it improve this much? Simple: Less disk I/O. Disk I/O = slow.

 

Disclaimer: This may not be desired. For example, build that is specified for "Production" you might want a "Full Build" in order to simulate a production release. You may have tasks in your build file that need a clean build. But for Continuous integration on the project, this setting is highly desirable.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Continuous Integration | SCM | TFS | Tools

Why Windows Task Manager Sucks

by Donn Felker 17. September 2008 03:12

It never fails... I'll boot up, start a program, walk away, log back into my PC and all of a sudden the disk light on my laptop or desktop is lit up like a Christmas tree for the next 10 minutes. The computer is rendered useless until its done "working". I can't do anything at this point but wait. A WASTE OF MY FLIPPING TIME.

The Problem With Task Manager

The problem is: I can't do anything while the disk is tripping on a couple of tabs of electric ecstasy ... opening task manager shows me... WELL... nothing. Task Manager says not a single process is utilizing CPU, and not a single process is over utilizing memory. Then I look at Disk I/O (which is presented in Read/Write/Other fashion) and It provides no valuable information at quick glance.

565234 Reads

88723412 Writes

WTF!?!

What I Want

When I look at task manager I want to see what tasks are my computer doing and what affects do each of these issues present. Right now I can only determine if something is a memory hog, or a CPU hog. I may see that SVCHOST.exe is running at 79% CPU utilization, but what the hell is running under the svchost context?!?!! Since svchost is a general host process name for services that from DLL's, I can't determine WHO is causing my pain.

So please tell me... Mr. Task Manager. WHO THE @#%! is spinning my disk. THAT IS WHAT I WANT TO KNOW.

You would think that after hmm.... 13 or so years of Windows OS's, Microsoft would have implemented this functionality. Its fairly rudimentary and actually VERY helpful in troubleshooting.

 

What I Did About  It

Fortunately this exact problem is something that other companies have recognized and have since developed an application I use regularly. Since I recently set up my PC I forgot to load this tool and I decided to write about it.

<Disclaimer>No, I'm not getting paid to write this about this product.</Disclaimer>

When I want to see what is going on in my PC I use Anvir's Task Manager Free Portable App (download link on the bottom). I bring it with me on my portable drive and flash sticks. Being a consultant who works on many machines, servers, or VPC's its nice to see what's going on.

Anvir has many features, but the one feature that I use it for the most is the "Disk Load". It shows exactly what is utilizing your disk and at what rate. You can sort on this column, therefore when your disk is playing Twinkle Twinkle Little Staryou can see what is causing it.

Here's a screen shot of what I'm talking about: (Click for larger)

image

I can now look at what is causing my disk to spin (as long as I can get AnVir open)! Anvir also allows me to see the processes under the svchost as well as look at startup items, processes, services, etc. It has a much more interactive and feature rich set of tools that you can use to help diagnose your troubles.

I've written about portable apps before - and I'll say it again - the nice part about this being a portable application is that I can use it on anyone's machine without having to install a thing. That's a thing of beauty. I can log into my mothers machine via SharedView and utilize it on her machine to see what her issues may be. Or even have her run it and tell me what she sees. Instead of seeing "svchost" I can now navigate to the service that svchost is working with. FINALLY.

I realize this may not be the BEST tool for this type of use, and if you have one that you feel is better, please leave a comment.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc | Productivity | Tools

Texting/SMS Your Mobile Phone From .NET (or any other technology)

by Donn Felker 10. September 2007 07:50

This is mainly a post for myself so I can have all the resources in one area, but hopefully it helps someone else out too.

There are a few ways to send a Text Message to your phone. The most common way is to send an email to your mobile provider. Here's a list of some of the mobile providers:

T-Mobile: phonenumber@tmomail.net 
Virgin Mobile: phonenumber@vmobl.com 
Cingular: phonenumber@cingularme.com 
Sprint: phonenumber@messaging.sprintpcs.com 
Verizon: phonenumber@vtext.com 
Nextel: phonenumber@messaging.nextel.com 
Update: 2007-09-12 - I found more email domains for the text messaging sites. 
sms.3rivers.net, 3 River Wireless
mobile.mycingular.com,Cingular
messaging.nextel.com,Nextel
tmomail.net,T-Mobile
vtext.com,Verizon
paging.acswireless.com,ACS Wireles
message.alltel.com,Alltel
message.alltel.com, Alltel PCS
alphanow.net,AlphNow
paging.acswireless.com ,Ameritech
mobile.att.net,AT& T PCS
text.bell.ca,Bell Canada
wireless.bellsouth.com,Bell South
bellsouth.cl,Bellsouth
myboostmobile.com,Boost
mobile.celloneusa.com,CellularOne
sms.edgewireless.com,Edge Wireless
mymetropcs.com,Metro PCS
qwestmp.com,Qwest
messaging.sprintpcs.com ,Sprint PCS
vmobl.com,Virgin Mobile
Where phonenumber = your 10 digit phone number 

If you know your company is going to only use ______ carrier, then you can set it up in your system to automatically send emails to the carriers address as listed above.

BUT what if you don't know the carrier? There are other services out there -

TeleFlipTeleflip allows you to send a  text message to anyone that can accept a text message. The caveat here is they reserve the right to sell your email (the from email) and the destination email (the phone# to you which your sending a text message). This service works GREAT, and if you don't give a damn about letting your email and phone number get out into the wild world of SPAM, then this  is the service for  you.

How to use:

Send an email to phonenumber@teleflip.com 

where "phonenumber" is the destination phone number you want to text.

Then include a subject and body in the email and send away. The user will get the text very soon.

TeleFlip reserves the right to advertise in your text messages and reserves the right to keep and read all of your texts. So... be careful what you send. But then again, you should be careful anytime  you text something, especially when its business related.

TeleFlip was almost a "slam-dunk" for my applications until I realized they stored all source/destination addresses and reserved the right to sell them. Unfortunately, I think this is going to cost them a lot of business.

 

webservicexnet WebServiceX.NET

Web Service X provides a service that's called SendSMSWorld and SendSMSIndia. You can send a lot of messages through this web service. I've heard that it works, but I've never been able to get it working. I ran into a few issues and the support and contact areas of the site didn't even work. I received exceptions when I attempted to use them.

Hmmm.... Betsy... this sure doesn't sound like a place I can trust. Its a good place to keep an eye one just in case they fix everything and it becomes reliable.

Conclusion

I'm aware of a lot of other services out there that send text messages for you but it seems to me the best way to do it is through the carrier. Find the carrier name, and then allow the app to send it to the carrier address. That's going to be the most reliable method to get texting to work (IMO).

There are other sites out there that allow you to send text messages for free, but they are not web services that you can connect to - txt2day.com and textforfree.net are examples of these. You could use the WebRequest class in .NET (which I'll be writing about soon) and Fiddler to build an auto submission routine for you, but that's a royal pain in the arse if you ask me.

So use what works best, but for ease of use, try out the carrier method first.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Tools

Simulating Bandwidth in Web Applications

by Donn Felker 10. September 2007 07:27

Many times during developing web applications you will need to simulate a users experience. Certain questions come up, such as:

  • Will this page load fast on a dial up connection?
  • What are the response times with my new AJAX functionality on a slow connection?
  • How long will it take the user to upload/download file xxx?
  • What happens when the connection is too slow?

Unfortunately its hard to simulate a users experience on 56k when you're running on a 100 megabit network. A lot of companies will simply just try to optimize their code for the worst possible scenario, whilst still being blind to what really happens on a connection that slow.

Fortunately there are ways to simulate a users slow connection.

[Note: I'm not getting any kickbacks from this company, its just a product that's helped me a TON.]

netlimiter-top-logo Net Limiter is one such product that helps us test these connection speeds. Net Limiter will allow you to select a product, such as Internet Explorer and limit it bandwidth usage. I can set it to 56k, so when I visit a web page (or a local development web server) it will only allow enough bits to pass through the wire to simulate a 56k connection.

Uses

I've used this to test web applications that utilize AJAX functions. I've used it to test uploads to my web site to see how long it would take. I've also used this to test Flash/ActionScript development.

You can also use this to test the speeds of your Silverlight Applications.

Here is a screen shot of the application in use. In the screen shot you can see the areas where you can limit the incoming or outgoing bandwidth. You can set a speed for either connection (incoming/outgoing) and you can limit one or the other.

nl2shot_limit

 

Conclusion

The question shouldn't be "why to test test network speed" but more or less "why would you NOT test your functional speed of your web application?" So before your users say your site is too slow, experience it yourself, first hand.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Tools

.NET Scaffolding

by Donn Felker 20. June 2007 20:19

Jeremy D. Miller has a great post on keeping source code where it belongs. The thought process behind this is that code should be where YOU would assume it would be. If its data access code, it should be in a project/namespace that is something like Data Access or DAL or Data or something that represents the lower layer of the architecture. If its the business rules/tasks the files should be in a project called Business Rules, or BLL, or Tasks, or something similar. It makes sense, just think about this -- if you walk into a business and are given a project that was created by another developer and you're getting a ADO.NET Exception, you'd expect to find the code Data Access code in a Data Access layer, NOT in the code behind. I should not have to hunt down where you put your data access code.

We're talking about basic separation of concerns. The thing is, many developers lack these concepts because they're under the assumption of "I can write this the correct way, and it will take me 2 weeks, or I can do it quickly and it will take me 2 days." This may not matter when the application is running for a few months, but when you are asked to change the data provider from SQL Server to Oracle, or remove the web service calls and replace them with RPC calls, you're going to find yourself in a world of hurt because you didn't set everything up correctly. At this point they have amounted a large amount of Technical Debt.

He also noted that a large number of people were now using Ruby On Rails (RoR) as their development platform and I won't deny that I also believe that Ruby/Rails is huge right now. Tons of shops are running RoR and even Martin Fowler said on Hansel Minutes that ThoughtWorks was doing about 40% (or more) of their business with Ruby. The key point Jeremy brought up is that "RoR forces web developers into a bit of a straight jacket, but that's a good thing in a way." I completely agree. RoR enforces a consistent source code tree layout which allows for developers to easily find there way around a project. "Developer A" can create a project with RoR and then "Developer B" can come along and take a look at it and be familiar with the code layout and structure. The RoR community has agreed that this is the basic way to organize a project and it seems to be working for them.

So what about .NET? Enter Tree Surgeon. Right now, its a stand alone application, but in its near future it should be implemented as a template in Visual Studio 2005/2008. So what is it? It's a application that will create that straight jacket that Jeremy spoke of. It gives the developer a basic set up of layers, unit tests, code coverage and build script. It builds the entire source code directory and allows you to build on top of it. The source code layout follows a white paper written by Mike Roberts. I've been using it for quite awhile and I'm one of the developers on the project. I recently updated the source to allow creation of Visual Studio 2005 projects. Please note, this is only on the source and has not been reflected on the production release. Download the source, run it and then choose a application name, and generate the project source directory tree. Open the solution file and your application is ready to go.

The best part is that its easy to integrate existing projects into this format. I've done it quite a few times to allow for easy integration into my clients CI environment.

If you have any requests for Tree Surgeon, please visit the Issue Tracker page and submit and issue.

Enjoy!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Code Generation | Continuous Integration | Productivity | TDD | Tools | Visual Studio 2005

Teamprise Explorer Client vs. Visual Studio Team Explorer

by Donn Felker 7. June 2007 09:43

Over the weekend I had the time to work with Teamprise Explorer and Visual Studio Team Explorer while working on an open source project that I'm a part of. This was the first time I've worked with Teamprise explorer and Visual Studio Team Explorer. Since Codeplex houses its source on Team Foundation Server (TFS) I was required to use one of these options. This is a little look into my experience.

First off let me start by saying that I'm a Subversion junkie. I keep all of my own personal source code in Subversion and I've helped many clients implement Subversion in my time. I'm an avid user of TortoiseSVN because of its ease of use within Windows Explorer. Working with TFS was very similar to that of Subversion but the terminology was different and in my opinion Teamprise was a little more difficult to use. I originally wanted to use the Visual Studio Plug-in but I didn't want to wait for the 246 MB file to download so I could install a plug-in. :\ Therefore, I went with Teamprise first. They will give you a free license to work with Codeplex if you're working on a project, so that was a win/win for me.

Teamprise Explorer Client will allow you to connect to a Team Foundation Server to access source code (its user interface reminds of me of WinCvs quite a bit, yet  a lot more polished than that of WinCvs). The only problem that I had with Teamprise is that when I went needed to edit the code I had to "Checkout for Edit". If I did this on the entire directory tree such as my "src" directory it would log everything in edit mode. Therefore, when I went to upload the changes the entire source tree was being uploaded. NO BUENO. I know that on average I like to see what I've edited (yes, I'm used to TortoiseSVN) in some type of explorer window. This didn't happen on Teamprise (maybe there is a way to see if a file has changed other than the Pending Changes window, if so, someone please let me know). In the end, I got frustrated, ended up clicking some button on Teamprise explorer and overwrote all my changes somehow. THAT SUCKS. I got frustrated and decided to download the plug-in and start working that way.

Visual Studio Team Explorer Plug-in was great. Its interface reminded me of the old days when I use to personally use Source Safe 6.0. The icons were similar and it was familiar ground. I think we may have a winner. After making my changes again I was able to easily see what changed through simple icon's changing colors and I checked everything in really easily. It was very seamless. The only downside to Visual Studio Team Explorer is the install process. First you have download an IMG file, then download an install an IMG extractor and then open the IMG, then install. Only then did I get the full Visual Studio Integration. Very nice.

One downside that I see is that the Express SKU's don't allow plug-ins so this kind of sucks for those guys. How can you have an open source hosting site that doesn't allow its users to easily get the source. Don't get me wrong, they can use Teamprise but they have to know there is a learning curve with that. I didn't have the patience for it this time around.

There is hope on the horizon though...

TortoiseSVN

CodePlex will be offering TortoiseSVN Support to Team Foundation Server. Therefore you will be able to use a tool such as TortoiseSVN to access Team Foundation Server. Supposedly this is to be released on or around June 18th of this month. In a nutshell there will be a bridge built between SVN Commands and TFS commands. I would assume this is a good place for the Adapter pattern to be put to work.

Hopefully this comes to fruition, I can see a lot of people possibly moving their projects to CodePlex if that's the case.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Continuous Integration | Productivity | Tools

Blogs, Podcasts and Screencasts

by Donn Felker 24. May 2007 21:01

UPDATE: I added the publications I also read at the bottom. :)

I've been asked what blogs I read, podcasts I listen to and screencasts I watch. So here's a comprehensive list for ya'll. :)

Blogs (in no particular order)

Then at times I'll browse the MSDN Blogs. Also note, these are what I call my "essential" blogs. I read these daily. I have about 30 other blogs that I read if I have time.

 

Podcasts (in no particular Order)

Other Podcasts I listen to when I can

Screencasts/Virtual Labs (in no particular order)

Publications

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | ASP.NET | Misc | Productivity | SharePoint | SQL Server | Tools

New Version Notepad++

by Donn Felker 9. May 2007 11:43

A new version of Notepad++ came out last week. I just got around to installing it and there are a few new features such as the enhancements made to the search/replace function. You can now search/replace through many different files through an improved interface and also search recursively.

There were some changes made to fix some bugs and a cool new feature that transforms all links that are typed into N++ to clickable links.

One of my favorite new features is the NppExec that allows you to run your own preconfigured scripts from within N++. Pretty cool. I wonder if you can run Powershell scripts from within there? Its worth checking out.

Also, if you have Aspell installed you can use it as a spell checker for Notepad++. I normally don't use Notepad++ for this but I can see its usefulness.

Links

Notepad++ Release Notes

64 Bit Version of the Shell integration (right click on any file and open it witn Notepad++).

Running Notepad++ from the command line (by typing "n" into the command prompt)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Productivity | Tools

Open Source .NET Wiki

by Donn Felker 10. March 2007 18:26

I've been on the hunt for a good .NET wiki that was open source and I think I've finally found one. The folks over at ScrewTurn Software have developed ScrewTurn Wiki.

Its GPL'd, built on .NET 2.0, does not require SQL Server 2005, works in a medium trust enviroment (that means that you hosted types can use it!) and has many other features which are listed here. The only two things that you'll need are:

  1. IIS5 (or better) with .NET 2.0 installed.
  2. One write enabled directory in the root of the wiki

 

If you need to see it in action, check out the .NET Tiers website. The guys over at .NET Tiers are also using this for their site.

This is definately something that can come in handy in the corporate world when you don't have something like SharePoint installed (which offers built in Wiki support).

 

kick it on DotNetKicks.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Tools

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  December 2008  >>
    MoTuWeThFrSaSu
    24252627282930
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234

    View posts in large calendar