Hacker News new | past | comments | ask | show | jobs | submit login

I'm still very much learning about the "wizard behind the curtain" stuff that makes apps run more smoothly - like NSOperation and background threads and GCD, best practices for CoreData, memory optimization using Instruments.

Can you please recommend any code examples and/or resources to learn more about iOS performance and code optimization? The WWDC 10 session videos on performance that I saw (131, 137, 147) that I tried to understand were enlightening.




Sadly I am not aware of any specific resources on iOS performance tricks or optimizations. You might find something of use in Aaron Hillegass' beginner's book on iPhone development (on http://www.bignerdranch.com/) - his previous book on Cocoa has gotten a lot of praise, and there's a good chance that his iPhone dev book holds the same quality.

The things I commented about in the code examples were mainly general cases of bad programming; f.e., one of the applications did a frame rendering pass via a loop that ran 100k times per frame, and as the first thing in each run of the loop (instead of just once at the start of the application) it initialized a few variables that end up having the same value through the entire run of the application, resulting in the unnecessary addition of 200k function calls with consequential variable declarations per frame, totalling 6 or 12 million extra function calls PER SECOND, depending on if the application rendered in 30 fps or 60 fps. While it might not look like a big mistake, things like these are easily picked up by people who might consider it sane, healthy and clean programming from an "engineering" perspective, but even the smallest mistakes can be the best recipees for killing handheld battery life and producing lousy software.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: