Program compiled in Visual Studio 2005 runs slower than VS 6

  • Thread starter Thread starter CR Support
  • Start date Start date
C

CR Support

Hi experts,

We are trying to migrate from Visual Studio 6 (C++ project) on Windows 2000
to Visual Studio 2005 SP1 on Windows Vista but found that the migrated
program runs slower in both OS.
A looping section of the original program (compiled with VC6) running in
Windows 2000 takes 400ms but the same program (compiled with VS 2005) in
Windows Vista but copied to the Windows 2000 machine (together with the VC
Redistribution libraries) to run takes 3000ms.
I believe there are other postings related to the degradation in performance
for programs compiled in Visual Studio 2005 compared to those in Studio 2003
or Studio 6.
Are there any patches released to solve the performance issues reported in
Visual Studio 2005 ? If there aren't at the moment, will there be a patch to
solve this issue in future ?
Thank you in advance.
 
Try build your program in Release mode with _SECURE_SCL defined to 0 (=
disabled). Put the #define _SECURE_SCL 0 *before* inlcuding other header
files.

A good place would be the top of StdAfx.h

// Disable _SECURE_SCL in release builds
#ifndef _DEBUG
#define _SECURE_SCL 0
#endif


HTH,
Giovanni
 
Hi CR,
We are trying to migrate from Visual Studio 6 (C++ project) on
Windows 2000 to Visual Studio 2005 SP1 on Windows Vista but found
that the migrated program runs slower in both OS.
A looping section of the original program (compiled with VC6) running
in Windows 2000 takes 400ms but the same program (compiled with VS
2005) in Windows Vista but copied to the Windows 2000 machine
(together with the VC Redistribution libraries) to run takes 3000ms.
I believe there are other postings related to the degradation in
performance for programs compiled in Visual Studio 2005 compared to
those in Studio 2003 or Studio 6.
Are there any patches released to solve the performance issues
reported in Visual Studio 2005 ? If there aren't at the moment, will
there be a patch to solve this issue in future ?

Are use using STL iterators?
Disable debug and checked iterators:

http://msdn.microsoft.com/en-us/library/aa985965(VS.80).aspx
http://msdn.microsoft.com/en-us/library/aa985982(VS.80).aspx
 
Thanks for your reply, Giovanni. I tried adding the _SECURE_SCL=0 in the
Preprocessor Definitions section of the compiler but the speed didn't improve.
By the way, the looping section of the codes does not use STL. Just memcpy
and _stricmp.

I noticed some other posts suggesting "#pragma function" for VS2005. I
managed to try it and it works. As _stricmp does not have intrinsic function,
I just have the memcpy listed in the pragma directive and the loop goes back
to about 400ms instead of 3000.

I will try _SECURE_SCL=0 for the other sections that uses STL.
Thanks for the suggestion.

CR Support
 
Thanks for your reply, SvenC. I tried adding the _SECURE_SCL=0 in the
Preprocessor Definitions section of the compiler but the speed didn't improve.
By the way, the looping section of the codes does not use STL. Just memcpy
and _stricmp.

I noticed some other posts suggesting "#pragma function" for VS2005. I
managed to try it and it works. As _stricmp does not have intrinsic function,
I just have the memcpy listed in the pragma directive and the loop goes back
to about 400ms instead of 3000.

I will try _SECURE_SCL=0 for the other sections that uses STL.
Thanks for the suggestion.

CR Support
 
Back
Top