Quote:Original post by MaulingMonkey#define _SCL_SECURE 0
And _HAS_ITERATOR_DEBUGGING 0, to be on the safe side.
Quote:Original post by MaulingMonkey#define _SCL_SECURE 0
Quote:Original post by Quat
Thanks for the replies so far.
One thing I recently tried was to stop using push_back. Instead, I just used vector::operator[], and kept my own size counter. This is now comparable to the array performance.
Quote:Original post by ToohrVyk// Bad: for(int i = 0; i < numVertices; ++i) m_vertices.push_back(v);// Good: m_vertices.insert(m_vertices.end(), v, v+numVertices);
Quote:I noticed push_back has a conditional statement (in case it needs to resize). Do you think that is the extra overhead? I read hardware does not like branching statements.
Quote:Original post by MaulingMonkey#define _SCL_SECURE 0
Quote:Original post by MaulingMonkey
Also, Kwizatz is showing off the perfect way to get your .reserve()s wrong, you want:
Quote:Original post by gdunbar I didn't know about _SCL_SECURE at the time, so I changed them all to do a C-style loop
Quote:Original post by SpoonbenderQuote:Original post by gdunbar I didn't know about _SCL_SECURE at the time, so I changed them all to do a C-style loop
Hooray, and that's why I don't like Microsoft adding these macros. The lowered performance (in the normal case, when you don't actively define/undefine the correct sequence of macros) just makes people drop the C++ standard lib entirely, and fall back to C-style code... Just how much security did that buy anyone?
Quote:Original post by f8k8
To be honest, I ended up just switching to my own custom array class instead because I couldn't be bothered with all these special defines to make Microsoft's STL work quickly.
Quote:Original post by MaulingMonkeyQuote:Original post by SpoonbenderQuote:Original post by gdunbar I didn't know about _SCL_SECURE at the time, so I changed them all to do a C-style loop
Hooray, and that's why I don't like Microsoft adding these macros. The lowered performance (in the normal case, when you don't actively define/undefine the correct sequence of macros) just makes people drop the C++ standard lib entirely, and fall back to C-style code... Just how much security did that buy anyone?
Negative amounts.