Saturn101's blog

By Saturn101, 3 years ago, In English

Hi brilliant people! Hope you All are doing great.... I have a question: My computer takes so much time to compile and run even a simple "hello world" program. In average it varies from 15 sec to 1 min. I just want to know what is happening under he hood. Is there any of you faced the same problem as me? And how did you solve that ? I would be very grateful if you guys help me find out the problem . Thanks in advance lovely people .

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Are you using-#include <bits/stdc++.h>, if so, you might wanna either use precompiled headers or just use the includes for the required things.

guide for precompiled headers

»
3 years ago, # |
  Vote: I like it +4 Vote: I do not like it

It would help to know which OS, compiler, and environment you are using.

»
3 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Try Precompiled Header Files #include "bits/stdc++.h"

If you're using some antivirus try to switch it off and then check whether it improves.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Wow. That's a good point man. My mcafee always detects..cpp as a virus. Let me try. Thanks a lot

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      This. Windows is very slow when it comes to reading many files, because every single suspicious file you read or write is checked by the anti-virus, synchronously. That's terrible architecture, but we have to deal with that. Many programmers I know just disable the anti-malware software for their source code directories and compiler directories.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

do you use gcc or clang?