Timeline for Use of Collections in Android Game Development is not encouraged?
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 14, 2011 at 23:22 | history | edited | AttackingHobo | CC BY-SA 3.0 |
deleted 3 characters in body
|
| Nov 12, 2010 at 20:03 | vote | accept | GamDroid | ||
| Nov 12, 2010 at 16:34 | comment | added | Nailer | Hehe, no hard feelings ;) | |
| Nov 12, 2010 at 16:19 | comment | added | Michael Klement | @Nailer: I agree with that post, too. I think we're talking past each other a little bit. I've watched the Google IO talk just now and I see that you should avoid memory allocation in the main loop or other performance critical sections for the reasons stated above. But not 100% of game code is performance critical, though most of it surely is. All I wanted to say is, that you should know where performance is critical and where it is not and act (or program) accordingly. | |
| Nov 12, 2010 at 15:48 | comment | added | Michael Klement | @AttackingHobo: I disagree. Optimizing blindly is not benficial, which is what your statement sounds like to me (correct me if I got it wrong). Chris Pruett also stated in the Google IO Video linked above: "Choose flexbility over speed every day of the week...until the gameplay is damaged." and I agree with this. | |
| Nov 12, 2010 at 15:21 | comment | added | AttackingHobo | @Michael Barth, That quote is completely irrelevant in game development. Most of the time, anything that is sped up will increase the performance of the game. A lot of time it is easier to figure out the faster way to do something and then use the optimization everywhere, than it is to write slow code, and fix later. | |
| Nov 12, 2010 at 14:50 | comment | added | Nailer | I find myself agreeing to this here post in this case: programmers.stackexchange.com/questions/14856/… Besides, the difference between using an enhanced for loop and a regular one is neglible for most programmers. As most programmers might even be more familiar with the regular for statement. | |
| Nov 12, 2010 at 14:18 | comment | added | Michael Klement | Sure, don't get me wrong: I didn't want to disagree with your answer. I just wanted to point out that you should optimize judiciously and at the right spots. There is no benefit in using Arrays over Collections at a spot that has a minimal impact on performance (say 1%). (Also discussed more elaborately here: developer.android.com/guide/practices/design/… ) | |
| Nov 12, 2010 at 13:39 | comment | added | Nailer | @Michael: You'd be hard pressed to find any high performance commercial game engine not doing as much as they possibly can to optimize their memory allocation patterns. Here's a long talk about the subject of realtime android games. It's a bit old, but most of it should still apply: youtube.com/watch?v=U4Bk5rmIpic | |
| Nov 12, 2010 at 13:24 | comment | added | user744 | @Michael: On today's systems, with fast caches and slow memory and multiple cores, memory allocations are about the most expensive thing you can do. | |
| Nov 12, 2010 at 12:48 | comment | added | Michael Klement | All valid points, but keep in mind: "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil". You should limit such optimizations to the spots where they are really necessary. In all other places, strife for a clear and simple design. | |
| Nov 12, 2010 at 12:11 | history | answered | Nailer | CC BY-SA 2.5 |