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/define_list_fix
parent
e2b6c51730
commit
9c669547ab
Loading…
Reference in new issue