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.
Some steps that you can take:
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.
precompile headers in the sublime text if not done.
In my case, the problem was with antivirus.
Thanks, uninstalling the antivirus worked.
I think it would be better if you can put .cpp file in exclusion from scanning, rather than uninstalling antivirus.
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?
Yes, most of the time Antivirus is problem.
Use WSL rather than CMD to compile.
Hi, can you please tell me how can we pre-compile headers in WSL?
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.
Can you give some numbers on how much faster WSL is (compared to CMD) on your local environment?
It varies from 0.7 to 1.1 seconds on my system without precompiled headers.