I think it is going to be highly JVM dependent.

I reworked it to call each twice (and reordered the tests)... the foreach is still faster. Ialso ran it on Windows (under Parallels) and got similar results, but in some cases the indexed was faster.

"server" times are tough to judge because normally the server is not going to compile until it hits it 10k times, but this can be configured...

I think this is a case where you need to make a judgement based on "expected behavior" as there are probably too many variables.

The 'foreach' should be faster in the general case for arrays as the bounds checking can be avoided.

But, I doubt the speed difference is going to matter much either way, and eventually the JVM impl will converge to near equal performance.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to