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

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

Hello Everyone!

I am currently using Windows 10. I run my C++ code in Sublime Text 3 which take around more than 2 sec to run a code which is too slow (I am just printing a variable). I have also tried to include precomplied header for stdc++.h but still running time is same. Can somebody please help me with this issue ?

Thank You

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

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

Don't include the stdc++.h header file, rather include the required header files manually to decrease the compile time.

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

I think you did something wrong on precompiling. In my case, precompiling reduced the compile time of bits/stdc++.h to about 0.7s.

  1. Are you using #include "bits/stdc++.h" instead of #include <bits/stdc++.h>? Only the first one work with precompilation.
  2. Is your precompiled stdc++.pch file located on (your_source_code_location/bits/~)?

Check these two. It will just use original non-precompiled stdc++.h file if one of those two fails.

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

Make sure that you compiled stdc++.h with your compilation flags. For example, my flags are

-std=c++17 -O2 -Wall -Wextra -DLOCAL

so I would compile stdc++.h with those flags.

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

east or west, codeblocks is best :D