Slow builds & copy operations
I’m working with some legacy code now, C# in Visual Studio 2005. The whole TDD thing is greatly hampered by slow builds. Today I investigated a bit. I captured the build log and sorted it, then removed duplicates. I then used vimdiff to compare the sorted file against the sorted, unique file.
It turns out that 8 minutes of my time is being wasted by 4760 file copy operations, all of them moving files from one bin/debug directory to another. This happens whether or not a file has changed, and whether I’m building the whole solution or just a small subproject.
I looked into the sln (solution) file and saw nothing that I can modify there. I then went to the .csproj files to see if I can modify the timing of the copy so that it only happens when something changes. It’s not explicitely there.
If I can remove the 8-minute overhead from my builds (most of which involve changes to one or two files in a subproject) then I can do TDD.
Otherwise we’re in a valley of despair: if the build were longer, we could do meaningful work while waiting. If it were shorter, we wouldn’t be wasting so much time and wouldn’t be hesitating to build/test. It is long enough to be daunting and short enough not to be worth a context switch.
Maybe there’s an msbuild expert in the readership of my blog?
