Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building takes long time. How fight with that?

Speaking about compiled languages (c# in my case) I think that problem would always remain, no matter how performant your develop machine is. Build time could be more or less depending on concrete environment, but often it's enough to make your attention wanna move from your task to something else like stackoverflow, youtube, twitter etc. and it's just very annoying.

I'm happy for java developers because of Java's dynamic class loading, but what can .net (and others) developers do to make build process less painful and obtrusive?

like image 942
kilonet Avatar asked Oct 18 '10 20:10

kilonet


3 Answers

We use multiple build configurations to trade-off between speed and a comprehensive build.

A full build does time-consuming things like FX cop analysis, ASP.NET compilation, all unit test projects, Entity Framework view pre-generation, etc.

A "fast build" typically takes just a few seconds and those the bare minimum needed to get the project running.

Developers switch between the full build and the fast build throughout their workflow, as needed.

like image 165
Craig Stuntz Avatar answered Nov 13 '22 08:11

Craig Stuntz


Don't the class files have to be build as well? Wouldn't that just put the workload to runtime in contrast to compile time? That's not really a difference isn't it? The bigger software grows, naturally, the longer it takes to build it, depending on the machine and not on the language or framework - this is the tradeoff for things like strong typing, interpreted byte code (or binary code depending on the language/compiler) instead of interpreted source code at each run (as you have with php and python etc). I don't think java improves things much, there will a timeframe you have to build your application in.

I think in comparision to C and C++ both C# and java have improved immensely on the account of compile time.

Just use the time for slacking off:

Compiling

source

like image 33
Femaref Avatar answered Nov 13 '22 10:11

Femaref


Some things to try:

  1. Defragment the drive containing your source code

  2. Exclude your source code folders from the virus scanner

  3. Exclude your source code folders from the Windows Search indexer

  4. Disable any Visual Studio extensions that you are not using

like image 3
Nathan Rivera Avatar answered Nov 13 '22 10:11

Nathan Rivera