GenCheckinNotesUpdateWorkitem task is the most expensive and takes most of the build time. The problem is worst when you launched the build for the first time for a new build type. Why? What can be done about it?

Some statistics related to builds in Team Build (for simple HelloWorld.csproj project)

  • 1st successful build (with UpdateWorkitem flag set to false) 
    •  1 file with 5000 changesets (GCNUW task takes 98.93 % build time)
    •  5000 files in 4 changesets, with each changesets containing 1300 files, (GCNUW task takes 72.18 % build time)
    •  5000 files in 357 changesets, with each changesets containing 100 files, (GCNUW task takes 90.65 % build time) 
    • 5000 files in 5000 changesets, with each changesets containing 2 to 5 files, (GCNUW task takes 90.83 % build time
  • 2st successful build (with UpdateWorkitem flag set to false)
    • 1 file with 5000 changesets (GCNUW task takes 2.42 % build time) 
    • 5000 files in 4 changesets, with each changesets containing 1300 files, (GCNUW task takes 3.25 % build time) 
    • 5000 files in 357 changesets, with each changesets containing 100 files, (GCNUW task takes 3.8 % build time) 
    • 5000 files in 5000 changesets, with each changesets containing 2 to 5 files, (GCNUW task takes 2.15 % build time)

Disclamer: Please note that I was using low end build machines (my dev box with 512 MB ram). Moreover the data mentioned above is for a very small/dummy HelloWorld project with has negligible compile time. We had the alternative rolling build setup. When we builded all VSTF sources for the first time using Team Build it took 1 hr-17mins-28secs-57millisec to build. The build churned out 1449 changesets. 

Learning

  • CPU consumption on AT went up to the maximum of 38% (w3wp.exe) while the GCNUW task was executing on the build machine.
  • GCNUW task takes the bulk of build time in 1st build when all the items are evaluated.
  • Get task takes bulk of build time in the 2nd build when the number of change sets are very less (or none)
  • Number of files associated with each change set does not impact the build time
  • Number of changesets has the direct impact on the task times

Machine Details 

  •  Client/BM on the same machine with configuration @ 2.79 GHz, 512 MB RAM
  •  AT configuration @ 3 GHz, 1 GB RAM