The discussion got rather heated, with lots of handwaving and citing of expert opinion. When the workshop broke for the evening, the argument continued in the hotel bar. A few people were heard discussing the merits of alternate loop strategies the next morning at breakfast.
By this point, the other teams were curious. For an argument this big, there must be something important going on -- some key technical learning to take home and impress the boss with. So, when the "most efficient loop" team presented their barely completed solution, everyone paid a lot of attention.
Their solution used the loop type they'd been arguing about exactly once, in initialization code. For all of the hours, and extra hours, they'd spent arguing about efficiency, the effect on the performance of their (barely completed) solution was negligible. The other teams hadn't gotten sidetracked, and all produced more elegant solutions.
This was many years ago. Since then, technology has advanced considerably. It's a lot easier now to prototype
benchmark alternatives. Human nature, though, hasn't changed, and the
lesson from this workshop of many years ago is just as true now as it was then:
Before you spend a lot of time and effort arguing over performance, make sure it matters.
In reply to Which way is faster? by dws
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |