Visual Studio 2017 Programs Slower Than Code::Blocks'

May 31, 2018 at 3:00pm
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?
May 31, 2018 at 3:03pm
Are you compiling in release mode?
May 31, 2018 at 3:05pm
In which IDE?
Last edited on May 31, 2018 at 3:05pm
May 31, 2018 at 3:20pm
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 May 31, 2018 at 3:21pm
May 31, 2018 at 3:32pm
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.
May 31, 2018 at 3:36pm
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 May 31, 2018 at 3:38pm
May 31, 2018 at 4:05pm
Sir, thank you for your help, I will try that, and inform you if it works :)
May 31, 2018 at 4:09pm
Yes sir, It worked very very very well now in Visual Studio 2017, I really really appreciate your help, sir, thank you :)
May 31, 2018 at 5:50pm
Glad to help :)
Topic archived. No new replies allowed.