I learned What was the cause of the problem, and it's intelisense.
How to speed up intelisense...
it's that MS Defender that comes with Windows 8 and 10 is slowing down intelisense.
Adding following processes and folders to exclusion list in secrutiy center speeds up intelisense:
1. Microsoft.ServiceHub.Controller.exe 2. ServiceHub.Host.CLR.x86.exe 3. ServiceHub.IdentityHost.exe 4. ServiceHub.SettingsHost.exe 5. ServiceHub.VSDetouredHost.exe 6. vcpkgsrv.exe 7. VcxprojReader.exe 8. Entry folder containing your project files
If you use different AV, then just put these processes to exclusion list in your AV settings.
Following are steps that can help speed up VS and intelisense:
Tools > options > environment > automatically adjust visual experience set to off and toggle on "enable rich client visual experience" tools > options > text editor > C/C++ > advanced > Code analysis > disable code analysis. Tools > options > text editor > all languages > codelens > disable codelens Tools > options > environment > international settings > same as MS Windows Tools > options > source control > set to none Tools > manage extensions > disable extensions set up precompiled headers for each project
edit: If the above doesn't work for a long time (as was in my case) then turn off Windows defender real time protection service. That indeed makes VS and intelisense respond instantly.