Блог пользователя AmanGupta_

Автор AmanGupta_, история, 7 лет назад, По-английски

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
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -25 Проголосовать: не нравится

Use computer instead of calculator

»
7 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Use precompiled header if you are using bits/stdc++.h, maybe it will speed things up.

With precompiled header: 0.62s

Without precompiled header: 3.38s

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

Don't use #include <bits/stdc++.h>. 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.