As many have pointed out, the answer should be "it depends".
While others have posted about some detailed technical issues that will influence performance, for most cases, the overall impact on system application performance may not even be measurable, let alone significant enough to impact performance.
What we use to determine which construct to use is often the skill level of our client companies development staff who will be living with the code for years.
If you are given a choice between the following two scenarios:
Scenario A:
* Code is implemented, and bug free in 1 hour by a junior developer
* Code is easily understood by all of the maintenance team.
* Code requires 50mS to execute in response to a button click.
Scenario B:
* Code is implemented, and bug free in 2 hours but required a senior developer
* Maintenance Team des not fully appreciate the implementation, and introduces a bug that causes an update to miss it's ship date..
* Code requires 10mS to execute in response to a button click.
If "Time is Money"....which is the faster code????
Our policy is to have a performance SPECIFICATION and performance testing from the very early phases. Provided the implementation meets (with a reasonable saftey margin) the specification, then the prime directive shall be the maximizing of Reliability, Maintainability by the broadest base of the avaiable resources. Sacrificing either of these for (unnecessary) performance gains is a losing proposition.
TheCPUWizard is a trademark of Dynamic Concepts Development Corp. Please visit us at www.dynconcepts.com