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

Автор Saturn101, 3 года назад, По-английски

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 .

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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 года назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

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

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

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 года назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

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

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится +11 Проголосовать: не нравится

      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 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

do you use gcc or clang?