How to decrease compilation time?

Asked

Viewed 1,863 times

8

I have a Solution with 20 projects, and most have a dependency relationship with each other. The build time takes a lot (6-8 minutes - may seem small, but it does a lot of damage when testing), even with changes in only one of the projects. To Solution is developing, so it has grown quite a lot, which worries me if that time increases much more.

The project in which the compilation is the most time consuming is the one that contains the entire WPF visual part (*. xaml and *.xaml.Cs)

  • Is there any way to shorten that time?

  • What usually leaves the compilation time too long?


Info. additional

Windows 10 64 bits, i7 2.7GHz, 16 Gb RAM. I use VS 2013.

I have tested in SSD and HDD, I got similar results, nothing glaring difference in the build delay. I’ve also changed the version of VS, tested with the VS2013, VS2015 and the VS2017 RC, the VS2013 is the one that best runs mine Solution.

I reiterate that it is a big project, I have more than 200 UserControls/Windows WPF, which ends up leaving the build of the only screen project (which I mentioned earlier) be the longest. (not that the others do not delay!)

I’ve changed several times these settings, today I use the default, but I’ve tried several things to try to decrease the build time, I didn’t get much result.

  • I have Solutions with several projects too but never seen anything like it. What is the configuration of your machine?

  • @There are twenty projects, but they are very big. I think the big problem is WPF, I may be wrong. I use an i7 2.7GHz with 16 GB of RAM. My OS is Windows 10. I have tested the Solution on different machines and different versions of the VS, the most performatic is the VS 2013, but even so, it takes about 6 minutes.

  • The build is done locally for the machine tester or you use a CI server?

  • Locally. @Intruder

  • You are running with some custom build configuration or default?

  • 3

    for corporate use (because it is expensive, and uses several/many machines) nothing in Incredibuild

  • 1

    Hi @Vinicius, regardless of the language I usually use an internal variable I call User_admin and Seto as True for the test case (inclusive). It allows certain forms/modules to be executed directly, that is, I partially load what I need to compile (when that’s the case) and run without starting the system from scratch and activate everything, I know that is not the solution to your problem, but this practice has helped even in cases without compilation, where additional seconds for testing interfere with programming productivity.

Show 2 more comments

2 answers

1

You first need to find out what the bottleneck is. Open the task manager while building see which hardware is 100% used, it’s probably the CPU. Shutting down Windows Defender or any other anti-virus is essential as they are great performance villains. Your hardware looks good, SSD helps a lot but the motherboard needs to sustain the speed, make sure in the copy of a large file(gigas) has the sustained speed to at least 380MB/s, if you do not have your motherboard is a bottleneck to the SSD. Also check if the AHCI option is turned on in the BIOS, this helps in disk performance. I would trade this processor for one with a higher clock, I think you should also use only 4 builds in parallel because i7 only has 4 cores despite being 8 threads. I have a great PC to test your build if you are interested just hand me the project.

0


I started using Visual Studio 2017. The build time dropped from 8 minutes to 4 minutes on average. Solved for me.

The visual part is still the most time consuming in the compilation. The test I had done on VS2017 was still in the RC version.

Learn more about the Visual Studio 2017.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.