Visual Studio 2017 Programs Slower Than Code::Blocks'

The programs I make in MSVC are very slow compared to that of Code::Blocks', why is that? The programs made in Code::Blocks are a lot faster, is this a compiler reason, or what? Can this be fixed?
Are you compiling in release mode?
In which IDE?
Last edited on
In which IDE?

Either one. Why don't you tell us? In, Code::Blocks, you should be able to see what the equivalent command-line is to compile your code. "Full optimization" for run-time in GCC is the -O3 flag (There's other, more specific options as well, but -O3 in general will do a lot of optimization).

What options do you have enabled for your VS17 code? See this article on on how to enable full optimization:
https://msdn.microsoft.com/en-us/library/59a3b321.aspx

How much difference (in speed) are we talking about? You mention "programs". Are you actually building the same program? Can you show a simple example of a program that runs slower in Visual Studio 2017 than Code Blocks (g++) (I have both on my computer to test).
Last edited on
I am not sure about MSVS, but in Code::Blocks, I am compiling in Debug mode. And yes, as you mentioned, I am building the very same program, I literally copied the header and source files, into a MSVS Solution. And it gave me very slow performance.
Okay, so follow the link I posted and try to turn on full optimization to see if that makes a difference.

And also, compile in Release instead of Debug in Visual Studio. (Configuration Manager --> Active solution configuration -> Release). Also try /O2 in MSVS.
Last edited on
Sir, thank you for your help, I will try that, and inform you if it works :)
Yes sir, It worked very very very well now in Visual Studio 2017, I really really appreciate your help, sir, thank you :)
Glad to help :)
Topic archived. No new replies allowed.