iPhone Game Optimizations. Ultimate Guide - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: iPhone Game Optimizations. Ultimate Guide (/thread-10355.html)
iPhone Game Optimizations. Ultimate Guide - Dimka - Oct 9, 2012 04:18 AM
I made a ppt presentation, where i described a lot of optimization best practices. Almost everything i know.
You can find it here.
Feel free to post your proposals, bug reports and feedback
P.S. English isn't my native language, so i will be thankful any comments about my writing style
RE: iPhone Game Optimizations. Ultimate Guide - Skorche - Oct 9, 2012 06:32 AM
Very nice set of slides. Some stuff in there I had never heard before.
Although I'd like to add about the GLKit math stuff that the issue isn't that it passes matrices and such by value, but the way it does them. Passing things by value to inline functions is normally fine and usually better than passing by reference as the compiler usually optimizes away the storage for the arguments. They either end up exclusively existing in registers when the function is inlined or having folding and constant propagation applied to them (even better). I've gotten a little "lazy" because of this, and the assembly output shows that the compiler generally knows what to do without me needing to hand simplify matrix multiplications for it.
The issue with the GLKMath stuff is that the *first* thing any of those functions do is to take the address of the arguments so it can cast them from it's own type to the NEON types. (/me facepalm) Thereby ensuring that the code has to keep pushing the values in the registers onto stack and read them back again constantly. You can see it in the assembly.
RE: iPhone Game Optimizations. Ultimate Guide - Dimka - Oct 9, 2012 06:47 AM
The other problem in GLKMath i found, was in Matrix4ByVector4 multiplication - it did modified original matrix.
Anyway. Thanks for your feedback! I have some more ideas to add to this material. Will see, when i'll have a time.
RE: iPhone Game Optimizations. Ultimate Guide - Skorche - Oct 9, 2012 07:41 AM
That's possibly true. In my case I was doing 2x3 matrices for 2D vector rendering stuff. Clang was inlining and folding those quite nicely.
RE: iPhone Game Optimizations. Ultimate Guide - SethWillits - Oct 9, 2012 08:42 AM
It appears these slides are for a talk. Where was this talk presented? Is there a video?
Would you be interested in writing an article covering each of the points in these slides (or at least the top 10)?
RE: iPhone Game Optimizations. Ultimate Guide - Dimka - Oct 9, 2012 08:50 AM
I did a talk for one local company, that do develop a software for iPhone. There are no video, however, the talk was not in English
You are not a first person, that asks me to write an article on all this stuff. I think, i'll be writing an article (every weekend), that will cover one (or two) slides with demo code.
P.S. If you'll help to spread the world, and more people will ask to write an article, that covers some particular slides, the more motivation i'll have to do this -> it takes much of the time and i do really have no time + i'm not good at writing stuff.
RE: iPhone Game Optimizations. Ultimate Guide - SethWillits - Oct 10, 2012 10:02 AM
Write it and they will come.
You may have a tough time finding "enough" people interested before you actually write it, but if you write it and we post it here, there will definitely be many people that find, read, and appreciate it.
What you write doesn't need to be a masterpiece from the start. That's where copy editors (AKA us) come in to correct typos, make the necessary changes to make the text clearer, find inaccuracies etc.
Start with one and see how it goes.
RE: iPhone Game Optimizations. Ultimate Guide - Dimka - Oct 10, 2012 11:32 AM
SethWillits, thanks for your support! I will devote some time at this weekend to write article about the most important optimization method - NEON code vectorization
RE: iPhone Game Optimizations. Ultimate Guide - godexsoft - Dec 2, 2012 12:01 PM
Hey, how is the article-per-week thing going? I'm ready to read some of your stuff if you wrote any.. Cheers
RE: iPhone Game Optimizations. Ultimate Guide - funkboy - Dec 4, 2012 10:57 PM
Dimka, it would be really great to see an article from this! Start simple, and there are people here at iDevGames that will help you clean it up and make a great article. I know I'm definitely interested in learning about these optimizations, and many people in my local iOS developer group would be, too.
RE: iPhone Game Optimizations. Ultimate Guide - Dimka - Dec 5, 2012 01:47 AM
I wrote an article on code vectorization, but that turned out to be a really massive work. It does need some updates. I will try to publish it this weekend
RE: iPhone Game Optimizations. Ultimate Guide - SethWillits - Dec 5, 2012 03:00 PM
Looking forward to reading it.
RE: iPhone Game Optimizations. Ultimate Guide - Fenris - Jan 11, 2013 02:06 PM
Same here, would be very interested in reading (and proof-reading, if you want us to!)