For-Each loop creates Iterator object and uses hasNext and next methods, which are slower, than manual iteration. Also allocating Iterator object increases work for GC. Forum post: https://hub.jmonkeyengine.org/t/iteration-over-list-performance-improvement/36250 See test 9 for more details: http://www.devahead.com/blog/2011/12/coding-for-performance-and-avoiding-garbage-collection-in-android/cleanup_build_scripts
parent
2c3d94a166
commit
93c2fd1989
Loading…
Reference in new issue