prajjwalsahu5432's blog

By prajjwalsahu5432, history, 4 weeks ago, In English,

Hi everyone! Can any one give me detailed steps how to decrease compile time in Code-blocks IDE it takes much time to compile the code approx 4-5 seconds and a little bit more if i use <bits/stdc++.h> header file . I am a beginner in CP so can any of you guys give me detailed instruction on how to configure my IDE to decrease it's compile time.

I saw some other post too about how to decrease compile time but didn't get it.

Please Help.

 
 
 
 
  • Vote: I like it
  • -16
  • Vote: I do not like it

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by prajjwalsahu5432 (previous revision, new revision, compare).

»
4 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

precompile the bits/stdc++.h header. That is, find it on your machine, and compile it with the same flags you use to compile .cpp files, but name it "stdc++.h.gch" https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I found my stdc++.h file but ain't getting what to do next how to compile it and save it as .h.gch extension.

    If you could provide every step after finding the file detail wise it would be very helpful.

    Please help a brother out.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      open your terminal and navigate to the directory where stdc++.h is located. Then compile it in the same way (the flags must be exactly the same to get the compile speed benefit) you compile .cpp files, but add the -o flag to name it:

      g++ [YOUR_FLAGS] -o "stdc++.h.gch"

      Now just include the line

      #include <bits/stdc++.h>
      

      in your code, and it should compile quickly. I use debug flag and sanitizers, and my programs still compile in < 2 seconds (I don't use codeblocks, I compile from the terminal).

»
4 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it
UltraSuperBest solution
  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Then, what do you recommend?

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      CP-Editor is a pretty good one, better with the CP Companion extension

»
4 weeks ago, # |
  Vote: I like it -10 Vote: I do not like it
UltraSuperBest^2 solution
»
4 weeks ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it
Ultrasuperbest^(1e9+7)solution
»
4 weeks ago, # |
  Vote: I like it -8 Vote: I do not like it

By changing your ide.