[ nice-Bugs-875682 ] extended for loop performance

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #875682, was opened at 2004-01-12 13:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=875682&group_id=12788

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Isaac Gouy (igouy)
Assigned to: Nobody/Anonymous (nobody)
Summary: extended for loop performance

Initial Comment:
Lies, damn lies & benchmarks!

Probably I'm making an obvious mistake and comparing 
entirely different things.  These numbers seem a little 
strange. (average of 10, code attached)

19653.2ms extended for, range
12951.5ms foreach, range

83364.1ms extended for, int[]
66637.5ms foreach, int[]
11343.7ms while, int[]

22995.3ms extended for, ArrayList<int>
15753.1ms foreach, ArrayList<int>
17650.0ms while, ArrayList<int>

309.4ms empty while loop

The extended for statement is very convenient - why 
the performance penalty compared to foreach?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=875682&group_id=12788


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.