Performance problem with _SECURE_SCL=0



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


.



Relevant Pages

  • Re: Why 64bit Delphi compiler from Borland may be meaningless!
    ... What I have learnt is the opposite. ... Except from structures stored in files where the location needs to be ... the compiler. ... optimization, in D2..D7, D2005, even in a Delphi 64 bit version. ...
    (borland.public.delphi.non-technical)
  • Re: cookies;javascript settings
    ... Most sites in the States don't seem to require cookies and JS, ... UK the opposite seems to be true. ... > How do I adjust these settings so I can get information ... > from websites that require these? ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Python from a Forth perspective
    ... freedom vs 'one way', cleverness being bad/good, optimization being ... bad/good, being the OS being bad/good, or the meaning of simple. ... these opposite things for people with opposite interests. ...
    (comp.lang.forth)
  • Drop shadow problem - fixed
    ... I saw this problem recently on 2 WinXP systems and fixed with following steps. ... Click the Advanced tab ... This is the opposite of what you'd expect, turn on the option to get rid of it! ... P.S I found a post on another site that says the cause is that the user profile Local Settings Desktop.ini file is corrupt and the contents should be cleared. ...
    (microsoft.public.windowsxp.customize)
  • Desktop Icon background
    ... I saw this problem recently on 2 WinXP systems and fixed with following steps. ... Click the Advanced tab ... This is the opposite of what you'd expect, turn on the option to get rid of it! ... P.S I found a post on another site that says the cause is that the user profile Local Settings Desktop.ini file is corrupt and the contents should be cleared. ...
    (microsoft.public.windowsxp.newusers)

Loading