+3  A: 

I don't see how the inclusion of:

_CRT_SECURE_NO_WARNINGS
_SCL_SECURE_NO_WARNINGS

..gives you a better or more performant build. All you are doing is disabling the warnings about the MS CRT deprecated functions. If you are doing this because you know what you are doing and require platform agnostic code fine, otherwise I would reconsider.

UPDATE: Furthermore the compiler can only do so much. I'd wager you would get more performant code if you instrumented and fixed your existing hotspots rather than trying to eek tiny percentage (if that) gains from the compiling and linking phase.

UPDATE2: _HAS_ITERATOR_DEBUGGING cannot be used when compiling release builds anyway according to the MSDN. WIN32_LEAN_AND_MEAN VC_EXTRALEAN (and probably NOMINMAX although performance isn't the chief reason to disable this) might give you some performance boost although all the rest have dubious value. You should favour correct fast code over (maybe - and I stress maybe) slightly faster but more risk prone code.

Konrad
I agree completely, but I must add that performant is NOT a word.
Charles Boyung
In the absence of a more suitable word what is the renegade linguist to do? Eventually the dictionaries will catch on. :-) (According to Jeff Boulter anyway)
Konrad
@Charles: According to Dictionary.com, it is. It's a performer in the same way an informer is an informant. However, I think this is a more than suitable word to express the concept and, after all, English dictionaries are descriptive rather than prescriptive.
Kaz Dragon
@Kaz Dragon - If you look at where dictionary.com is getting that definition from, it is from "Dictionary.com's 21st Century Lexicon", which is not an actual dictionary, which means that it is slang, and not even slang that real dictionaries even acknowledge, like "ain't". And even though MOST English dictionaries are descriptive, it doesn't mean you should just make up words because you can. Exactly what is wrong with using "better performing" instead of "more performant" in the statement here. It uses real words and still conveys the exact same meaning.
Charles Boyung
@Charles: you're really fighting a losing battle here. I predict within 20 years or so, dictionaries will be utterly useless. If *you* want to restrict yourself to using only formally-defined words, that's fine, but don't expect to be able to function in modern society...
@STingRaySC that is one of the most ridiculous comments I've ever seen. Dictionaries will be useless? I don't even know how someone with a modicum of common sense could ever think that. Yes, new words are created and eventually become part of the language, but using words that have not reached that point in any sort of professional setting just makes you look ignorant to your peers and superiors.
Charles Boyung
@Charles: that's funny, because I would have expected someone with a modicum of common sense to realize I was being facetious.
@Charles: Oh, and just how do you think words "... [reach] that point in any sort of professional setting"? Maybe, **by using them**?! Just let go of it. The English language is decaying before our eyes. You can't stop it! Consider yourself fortunate when you can understand enough of the words that someone utters to have some basic semblance of what he/she is trying to communicate.
It's not *decaying*, @Stingray; it's *changing*. New words come into existence. Old words acquire new meanings. Some meanings go away. It's a process that's been happening for hundreds of years.
Rob Kennedy
Slang words are still words, @Charles. I don't see how you can say that the word doesn't count because the definition comes from "Dictionary.com's 21st Century Lexicon." Lexicographers found the word and composed a definition based on how they observed it being used. What difference does it make whether they were working for Dictionary.com or Merriam-Webster? What distinguishes something that looks like a dictionary from an "actual dictionary"? I promise you Konrad did not "make up" *performant*. It's a word used all the time. http://www.wordnik.com/words/performant
Rob Kennedy
Getting back on topic: Do the "lean" macros really affect performance at all? I though they were meant to control which headers, functions, types, and other identifiers would get included when you `#include <windows.h>`. It doesn't affect any executable code, does it?
Rob Kennedy
Bah, the English language would be so much better off if *no one* ever used it! Just like Latin. ;) As for "performant", I've seen the word used quite often. If you want to talk about looking ignorant, I'd say pretending not to understand the word is a better way to do it.
jalf
Amen, jalf!....
@Rob Correct. Whether this leads to improved execution speed or simply a reduced binary size I don't know.
Konrad
@Rob - the difference is that slang words (and non-standard definitions) should not be used when writing something in a professional context. I know that some people think that writing on the web is not a professional context, but on a site like this, and on the many technical blogs that decide to use this non-word, it most definitely is a professional context.
Charles Boyung
@Rob - also, as for the validity of "Dictionary.com's 21st Century Lexicon.", all you need to do is talk to a linguist or a grammarian. Ask them to give you a list of sources that could be defined as valid sources of English language knowledge. Dictionary.com will not be one of them (except for when their source is one of the "real" dictionaries).
Charles Boyung
@Charles: I would, but I don't happen to know any linguists or grammarians, and I'm pretty sure I don't want to know any. They serve roughly the same purpose as a corporate ethics committee. Also, you may wish to reconsider your use of the term "non-word," as I'm not able to find it in any reputable dictionary (closest match is "nonword," so I'll go ahead and assume that's what you mean). If you think linguistic and grammatical accuracy is paramount in a venue such as this, perhaps you should be examined for OCD. Medication could make it much easier for you to use stackoverflow.
@Charles: Arnold Zwicky is a linguistics professor at Stanford. He cited Dictionary.com's lexicon as a source in his own research earlier this year: http://arnoldzwicky.wordpress.com/2010/02/28/ottles/. Also, I should have said before that I disagree with your classification of the word as slang. If labeled as anything, it's jargon, and when writing in a professional context, it's perfectly acceptable to use jargon from the profession you're writing about. *Performant* is a real word; absence from a dictionary doesn't change that.
Rob Kennedy
I wish people would have commented this much on the actual questionation rather than talkifying my usinglyness of the word "performant"! :>
dman
@konrad: Regarding _CRT_SECURE_NO_WARNINGS and _SCL_SECURE_NO_WARNINGS its more about bringing some sanity to the compiler diagnostics rather than optimisations.
dman
@konrad: Regarding _HAS_ITERATOR_DEBUGGING, believe it or not it does have a positive effect on performance for release mode compilations - give it a try,
dman
@konrad: Regarding optimisation flags, I've used them all, fast code, full optimisation etc.. basically I've found fast code and to favour fast code over small code to be the best option. when doing PGO, the result is roughly 1%-2% better which is not that useful when considering how long it takes to perform PGO and the issues of compiling highly complex structured code for production purposes using PGO.
dman
@darid - how exactly do '_CRT_SECURE_NO_WARNINGS' and '_SCL_SECURE_NO_WARNINGS' bring more sanity to compiler diagnostics? Also this question is about optimisations hence the reason I highlighted them. Also I think you've missed the point, rather than using PGO blinding - /instrument/ your code in real world tests and improve hotspots. That done well will be a better use of your time and give you a better code base.
Konrad