### AmanGupta_'s blog

By AmanGupta_, history, 2 years ago,

I am using g++/MINGW on Windows. I observe that it takes lot of time to build c++ programme. Programme written on language like java or python build almost 10 times faster in my system. May anyone suggest what changes i need to make in order to make c++ build as faster as others.

• +14

 » 2 years ago, # |   -25 Use computer instead of calculator
 » 2 years ago, # | ← Rev. 2 →   0 Use precompiled header if you are using bits/stdc++.h, maybe it will speed things up.With precompiled header: 0.62sWithout precompiled header: 3.38s
•  » » 10 months ago, # ^ |   -7 How to use precompiled headers on Windows?
•  » » » 7 weeks ago, # ^ |   0 I found this blog helpful
•  » » 7 weeks ago, # ^ |   -8 But seriously, how do we precompile headers?
 » 10 months ago, # |   -7 Don't use #include . It greatly increases compilation time because you're compiling every header in the standard library. There are ways to precompile bits/stdc++.h but IMO it's easiest just to type out the proper headers. Other than that, it's normal for C++ to compile a lot slower than Java. C++ is known for its long compilation times.
•  » » 10 months ago, # ^ | ← Rev. 2 →   -10 Well, there is an easy but ugly way to use it and compile quickly at the same time. You can just edit bits/stdc++.h and type there headers which you want to use. It can sped up compilation process significantly.
•  » » » 10 months ago, # ^ |   -7 If you're going to bother with that just precompile bits/stdc++.h.
 » 7 weeks ago, # |   0 I had a same problem, and that's one of the reasons why I use linux. Most probably the problem is that your antivirus (if you have one) is checking the code every time you run it, if there are some viruses in it.