VS2015 Generates Slow Code (Again...)
Posted: March 4th, 2017, 12:16 pm
I'm back again with another rant. There was this:
http://www.planetchili.net/forum/viewto ... lit=vs2015
Now I'm having a similar problem. I have a heightmap that has 2049 x 2049 elements. There is a simple smoothing function that is simply averaging each element's value with its closest 8 neighbors. Oh and it also does bounds checking (don't include the neighbor if it's outside the bounds, simple stuff).
Now I'm running it in Visual Studio 2015.
And you guessed it: VS2015 generates code that is SLOW AS HELL!
I'm using windows 10, Visual Studio 2015. I also have VS2013, VS2012 and VS2010 (and their respective compilers) installed so I can build a project with different compilers ("platform toolsets") in Visual Studio 2015.
My test results (All taken in VS2015 but with different compilers):
DEBUG BUILD
VS2010 Compiler (v100):
Loading heightmap... time elapsed = 0.50 seconds!
Smoothing... time elapsed = 3.37 seconds!
VS2012 Compiler (v110):
Loading heightmap... time elapsed = 0.47 seconds!
Smoothing... time elapsed = 3.40 seconds!
VS2013 Compiler (v120):
Loading heightmap... time elapsed = 0.52 seconds!
Smoothing... time elapsed = 3.41 seconds!
VS2015 Compiler (v140):
Loading heightmap... time elapsed = 3.23 seconds!
Smoothing... time elapsed = 13.12 seconds!
What. The. HELL!
2010, 2012 and 2013 results are essentially the same but 2015 result is dramatically slow.
Compiler optimizations are disabled for all debug builds by the way.
Release builds are all same and fast though:
RELEASE BUILD
Loading heightmap... time elapsed = 0.02 seconds!
Smoothing... time elapsed = 0.10 seconds!
P.S. : When I tried setting a breakpoint to debug it using compiler versions prior to 2015 (v100, v110 and v120), it said breakpoint won't be hit because symbols are not loaded for this file. Breakpoints work fine with 2015 version (v140) though. Don't think it's relevant but decided to share.
Why is there such a huge performance difference ?
I'm uploading the .cpp and the heightmap used (.raw file). Can anyone test it? Those of you that have VS2015 and other version(s) of VS I mean.
http://www.planetchili.net/forum/viewto ... lit=vs2015
Now I'm having a similar problem. I have a heightmap that has 2049 x 2049 elements. There is a simple smoothing function that is simply averaging each element's value with its closest 8 neighbors. Oh and it also does bounds checking (don't include the neighbor if it's outside the bounds, simple stuff).
Now I'm running it in Visual Studio 2015.
And you guessed it: VS2015 generates code that is SLOW AS HELL!
I'm using windows 10, Visual Studio 2015. I also have VS2013, VS2012 and VS2010 (and their respective compilers) installed so I can build a project with different compilers ("platform toolsets") in Visual Studio 2015.
My test results (All taken in VS2015 but with different compilers):
DEBUG BUILD
VS2010 Compiler (v100):
Loading heightmap... time elapsed = 0.50 seconds!
Smoothing... time elapsed = 3.37 seconds!
VS2012 Compiler (v110):
Loading heightmap... time elapsed = 0.47 seconds!
Smoothing... time elapsed = 3.40 seconds!
VS2013 Compiler (v120):
Loading heightmap... time elapsed = 0.52 seconds!
Smoothing... time elapsed = 3.41 seconds!
VS2015 Compiler (v140):
Loading heightmap... time elapsed = 3.23 seconds!
Smoothing... time elapsed = 13.12 seconds!
What. The. HELL!
2010, 2012 and 2013 results are essentially the same but 2015 result is dramatically slow.
Compiler optimizations are disabled for all debug builds by the way.
Release builds are all same and fast though:
RELEASE BUILD
Loading heightmap... time elapsed = 0.02 seconds!
Smoothing... time elapsed = 0.10 seconds!
P.S. : When I tried setting a breakpoint to debug it using compiler versions prior to 2015 (v100, v110 and v120), it said breakpoint won't be hit because symbols are not loaded for this file. Breakpoints work fine with 2015 version (v140) though. Don't think it's relevant but decided to share.
Why is there such a huge performance difference ?
I'm uploading the .cpp and the heightmap used (.raw file). Can anyone test it? Those of you that have VS2015 and other version(s) of VS I mean.