Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

### pranshukas's blog

By pranshukas, history, 2 years ago,

I am using Sublime Text Editor for Writing C++ Programs but it's taking too much time to Compile even small Programs. Even printing Hello World takes 4-5s.

I have been using Windows 10, My PC Configuration is — i7 9750H, 16GB Ram, and 512GB SSD. I am still wondering why is it still slow. I have seen many Competitive Programmers during screencasting videos using Sublime text and their Compile Time is merely 0.8-1.2s. But mine is taking too much time which cost me patience and time During Contests.

One thing that I have seen is those Competitive Programmers were using macOS or Linux. I was wondering if Sublime Text really slow on Windows or I have done some mistakes while installing it.

I have tried Googling my Problem but unable to find any solution, I had asked this Question on Stackoverflow also but there also I didn't get any reply.

Please Someone Help me fixing it or comment on some related article that I can read to fix it.

Below is ScreenShot even this small Program took 15.3s ->

• +6

| Write comment?
 » 2 years ago, # |   +5 I suggest using precompiled header.
•  » » 2 years ago, # ^ |   -11 I tried making my Precompiled Header Files and it's running fine on my local system but when I am trying to submit it on online judges it's showing no such files found. How can I make a precompiled file that would be automatically attached while submitting solutions on Online Judge.
•  » » » 2 years ago, # ^ |   0 Refer to point 5 on this blog. I have done using this.
•  » » 12 months ago, # ^ |   0 I precompiled the header files and it was going smooth but suddenly now it's taking a long time for compilation!!!
 » 2 years ago, # |   +25 Try disabling your anti-virus if you have any 3rd party anti-virus.When my compilation slowed down disabling anti-virus helped.
•  » » 18 months ago, # ^ |   0 thanks man :>
•  » » 9 months ago, # ^ |   0 Thanks! It worked!
 » 2 years ago, # |   +11 I have used sublime text both on windows and ubuntu , and it does seem that sublime works faster on linux systems. Still, it is weird. More than 15 seconds to run the program , it is just crazy. On ubuntu, it takes about 0.5 to 1.5 seconds in general, if I have precompiled headers. For windows, it takes about 3-5 seconds, even with precompiled headers. Still, I have seen people run sublime quite smoothly on windows, so yeah it is weird.Sublime behaves differently on different systems, and on different machines too, which sucks bad.
•  » » 2 years ago, # ^ |   -8 The Same Thing happens to me. But generally, the compilation is more than 5-10s. Have You Created Your own build System or Sublime Text c++11 one?
•  » » » 2 years ago, # ^ |   +3 I am using the sublime text c++ 11 one. I think that the custom build is slightly slower, but again, some other people might have seen different results.
•  » » 2 months ago, # ^ |   0 sir, i use ubuntu and somehow I also precompiled my header. So after 1st run it generates output in mili second(despite any change at testcase or slight change in code), but while running a completely new problem code and test case for the first time it takes almost 10 seconds. is it might be cause I have only 4gb ram and no ssd?
 » 2 years ago, # |   -28 Try "bits/stdc++.h" instead of
 » 2 years ago, # |   0 Earlier I used to get speed of 0.8 -1.5 sec. Now after reinstalling all it takes first compilation to 15-20 secs..After that it return to normal speed of 1-2sec..I also used precompiler headers but no effect
 » 2 years ago, # | ← Rev. 3 →   +5 Turn off anti-virus. change power plan to Balanced (recommended) precompiled header file custom C++ Sublime Build (windows)
 » 2 years ago, # |   0 As someone already mentioned, it is a common issue with third-party antivirus. Try excluding those folders from antivirus where your .exe files get created.Immediate solution would be to switch to an online IDE.ps: If you have McAfee antivirus, there is no solution but either uninstall it or deactivate there Realtime scanning whenever you compile your code because they don't provide folder exclusion option.
•  » » 2 years ago, # ^ |   0 Yeah, I have McAfee Antivirus installed, will uninstalling it and switching to Windows defender will solve the Problem? Or will I need to turn of Windows Defender too?One more thing Can just turning off Real-Time Scanning in McAfee will solve the issue ?
•  » » » 2 years ago, # ^ | ← Rev. 2 →   +3 Try to do compilation after uninstalling McAfee and if it works out, then uninstall it forever. My personal opinion, McAfee is shit and it slows down your system more than it protects it. If you are a casual user (not much into the deep web and torrents), then Windows defender will get the job done. Just never install untrusted applications and you should be good to go
 » 2 years ago, # | ← Rev. 2 →   0 Just write around 8-10 most frequently used header files instead of writing . This greatly decreased my compile time.
 » 2 years ago, # |   0 In my laptop, there is a pre-installed app that could switch my laptop between performance/battery mode (not the one from Windows Settings/Control Panel). Compiling a hello world program (with bits/stdc++.h precompiled) takes 0.3-0.5s on performance mode and 1.2-1.4s on battery mode. Turning off Windows Defender reduces the compilation time by ~0.1s in my case.
•  » » 18 months ago, # ^ |   0 Can you tell me the name of the app, please? Is it the one which comes with HP laptops?
•  » » » 18 months ago, # ^ |   0 MSI Dragon Center
 » 2 years ago, # |   +3 Install WSL, and make your build system run commands on WSL terminal, rather than CMD.
•  » » 2 years ago, # ^ |   0 Does this shorten compilation time?
 » 2 years ago, # | ← Rev. 2 →   0 Earlier I had the same issue. It took around 15-17 seconds. After disabling my antivirus it came down to 1.5-2 second.Use precompiled headers or stop using
•  » » 2 years ago, # ^ |   +3 I am not able to understand what does it mean by Precompiled Header File. I made a header file temp.h and included in my program #include "temp.h" but when I submitted it on online judge it's giving Compilation Error. No Such files found. But it's running on my local system.Can You Please Help me out. How to create Precompiled Header Files which would work on online judges as well. Please tell me or attach any tutorial or video so that I can learn. I tried Googling up end up getting confused. Even I am asking people here in the community but I don't know why people are insanely just downvoting me instead of helping.Hope You Help !! Thanks
•  » » » 2 years ago, # ^ | ← Rev. 2 →   +5 See, bits/stdc++.h includes all the header files in c++ so obviously it takes a bit longer to compile. So by precompilation you can compile the header file so it reduces the time of including and compiling all the header files. Refer to the first comment and precompile your header file. Hope this helps.
 » 2 years ago, # |   +3 Also, turn off O2 optimization will also reduce compilation time if you're not stress testing.
 » 2 years ago, # |   +3