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

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

Recently my simple code in sublime text is taking up a lot of time to compile and run. Like for simple taking input an array and then printing it, sublime is taking about 7-8 secs. It doesn't always happen but when it happens during a short contest it's frustating. Can anyone suggest me ways to decrease the compile time? Thanks for noticing this blog.

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

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

Some steps that you can take:

  1. Uninstall your antivirus, because every time your cpp file is executed, the antivirus checks it and this is the reason it sometimes takes 7-8 s.

  2. precompile headers in the sublime text if not done.

In my case, the problem was with antivirus.

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

    Thanks, uninstalling the antivirus worked.

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

      I think it would be better if you can put .cpp file in exclusion from scanning, rather than uninstalling antivirus.

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

        while executing a .cpp file, it opens .exe file to execute the code, so i think excluding .cpp won't help, maybe excluding the folder where you save your code will help?

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

    Yes, most of the time Antivirus is problem.

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

Use WSL rather than CMD to compile.

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

    Hi, can you please tell me how can we pre-compile headers in WSL?

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

      You may not need that, it compiles pretty fast, but if you still intend to do it, just follow any linux instructions for doing it, its mostly same in WSL.

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

    Can you give some numbers on how much faster WSL is (compared to CMD) on your local environment?