Performance problem with _SECURE_SCL=0
- From: "Ayal" <ayal@xxxxxxxxxxxxxxxxx>
- Date: Thu, 8 Mar 2007 16:20:47 +0200
In VS 2005 I defined _SECURE_SCL=0 in my project in order to get better
performance, but the result is the opposite.
As a test, I wrote the following sample program:
int _tmain(int argc, _TCHAR* argv[])
{
vector<int> vec;
StopWatch s;
s.start();
for(int i = 0; i < 50000; ++i)
{
int x = i;
if(find(vec.begin(),vec.end(),x) == vec.end())
{
vec.push_back(x);
}
}
s.stop(); // This writes to cout the time passed since it was started
return 0;
}
In the settings of the project I set the optimization to custom and choose
/Ot. all other are set to the default.
The results:
with _SECURE_SCL=1 it takes about 4 seconds
with _SECURE_SCL=0 it takes about 29 seconds !
Can someone explain me why?
Thanks,
Ayal
.
- Follow-Ups:
- Re: Performance problem with _SECURE_SCL=0
- From: David Lowndes
- Re: Performance problem with _SECURE_SCL=0
- Prev by Date: Re: Method should return list<>, instead returns BOOL, no error. Why not?
- Next by Date: errors C3853, C2440, C2678
- Previous by thread: Method should return list<>, instead returns BOOL, no error. Why not?
- Next by thread: Re: Performance problem with _SECURE_SCL=0
- Index(es):
Relevant Pages
|
Loading