chucky wrote:

> [...]

> Can the second approach be faster than the first one?
Yes, it can be faster.

A question you didn't ask but perhaps should have:

"Is the second approach faster than the first one?" The

answer is "Write it both ways and measure." (Measuring

can be tricky.)

A question you didn't ask but *definitely* should

have: "Is the potential speed improvement worth worrying

about?" One way to begin thinking about this question is

to imagine using a Magical Mystery Method that takes zero

time. How much difference would this infinite improvement

make to the running time of your program as a whole? The

answer establishes an upper bound on the amount of time

you should be willing to spend working on a speedup.

--

Eric Sosman

http://www.velocityreviews.com/forums/(E-Mail Removed)lid