[ 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 22:20 Message generated for change (Comment added) made by arjanb 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? ---------------------------------------------------------------------- >Comment By: Arjan Boeijink (arjanb) Date: 2004-01-12 22:49 Message: Logged In: YES user_id=688815 Surprising benchmarks I would say. The int array is doing badly because it's converted to an object array and I know that foreach and extended for aren't tuned yet. But I will try to improve the numbers for Nice a bit. BTW I don't see an attachment with the code. ---------------------------------------------------------------------- Comment By: Isaac Gouy (igouy) Date: 2004-01-12 22:23 Message: Logged In: YES user_id=536291 Warning: this takes 30 minutes or so on P4 2GHz WinXP java version "1.4.2_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06) Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode) Nice compiler version 0.9.6 prerelease (build 2004.01.10, 17:42:12 UTC) ---------------------------------------------------------------------- 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