Search code examples
c++vimg++mingw

MinGW g++ extremly slow compiling


I started using Vim for C++ competitive programming and i have a problem . For compiling i am using MinGW g++ compiler as in tutorials . Code compiles , but i have issue that , any program compiles and runs extremly slow . For example to compile and run next code:

#include <iostream>
using namespace std ; 

int main()
{
 cout<<"Hello World"<<endl;
}

(simplest programm ever) It takes 6 to 8 seconds to compile and run .

In Vim itself i have this shortcut :

autocmd filetype cpp nnoremap <C-r> :w <bar> !g++ -std=c++14 -Wall % -o %:r && %:r.exe <cr>

Can you help me to findout why i am having such an issue . For instance William Lin ( competetive programmer also uses Vim and mine shortuc is similar to his , but his programs runs instantly ).


Solution

  • It's an shame to say this , but problem was in Antivirus . As i think it slow downs process to check for some virus