We are experiencing some weird lag in our games only on the iPhone 3G. Even the 2G is working really nice and smooth. Has anyone else had the same experience? By doing a google search there seems to be some issues with the 3G phone?!
Only 3G. Seems that performance is a little weaker than the other phones. 3GS and 2G works great without lag. Maybe the OS version for 3G (3.0)?
What are you using for timing? NSTimer or a thread? If you're using a thread, Apple engineers suggest you avoid using CFAbsoluteTimeGetCurrent() for timing, and instead use CACurrentMediaTime(). This is because CFAbsoluteTimeGetCurrent is sync'd with the network, while CACurrentMediaTime is not. Actually, I recommend you get on to the developer forums on Apple's iphone development site and search around. There are some really good threads on the differences between the different devices, and Apple engineers will pop up from time to time to give advice (this is where I heard not to use CFAbsoluteTimeGetCurrent, for example). HTH
Yup, it is indeed much slower. I made a similar thread a while back... Here's a link to an article: http://smokingapples.com/iphone/ipod-touch-2g-processor-faster-than-iphone/
Before firmware 3.0 you could list the devices in this order...Pre 3GS and iPod 3rd generations. 1. iPod 2nd gen 2. iPhone 3G 3. Iphone 2G 4. iPod 1st gen This is now wrong with firmware 3.0. The order is now in performance: 1. iPod 3rd gen (top because of no phone functions running in the background) 2. iPhone 3GS 3. iPod 2nd gen and low memory iPod 3rd gen (same hardware as 2nd gen) 4. iPhone 2G 5. iPod 1st gen 6. iPhone 3G (push notifications and other background tasks ruin the framerate) The iPhone 3G is not so good for games now.
You sure about that? Video on the 3GS is undoubtedly faster, but the 3GS has a deprecated VFP unit that runs more slowly on the 3GS than 2G devices. Thus, if a game uses VFP optimizations for heavy duty floating point operations (such as matrix operations), the game will certainly run more slowly on the 3GS. If the physics engine is struggling at 20Hz on the 3GS because the matrix operations were optimized for only the VFP unit, it doesn't really matter if the video is running at 60fps; it's still going to be jerky and laggy and overall a shitty experience for the player.
iPhone 3G is exactly the same speed as iPhone 2G and iPod 1G, if there are differences then it must be some device-depending thing (email push or pull enabled or similar). The iPhone 3GS is much faster than the previous generations, especially if you compile for armv7 (iPhone supports universal binaries).
Hello, your statement is very interesting, can you elaborate a bit much about VFP deprecation for 3GS ? I heard that Neon native instructions would surpass VFP for 3GS, is it true ?
The NEON chip is certainly quicker than the VFP unit. In the fact the 3GS VFP has been shown to be slower than even standard compiled code! Unfortunately there are not many benchmarks out there comparing the two, but here is one benchmark showing the VFP to be a order of magnitude slower than the NEON on the 3GS. My own benchmarks show similar results. Here is another interesting about the differences between the two chips. There's one thing I want to point out though: A game with decent NEON optimizations will run beautifully on the 3GS. What you need to do is create a fat binary with one code branch for armv7 which supports NEON, and the other for armv6 (VFP), and then you'll be golden. bomber mentioned this in a previous post. However, the universal binary presents you with a new problem. While you can target both the NEON and VFP unit from within the universal binary, you will have to target OS 3.0 as the minimum OS in your Info.plist before you can submit the binary to Apple. You can not submit anything with a minimum target OS less than 3.0. Try it on iTunes Connect and see - you'll just get an error. In other words, you can certainly have a universal binary with NEON optimizations for 3GS and VFP optimizations for everything else, but you will not be able to sell to the millions of iPod Touch owners who are still running OS 2.x. This is a policy decision by Apple. There's no technical reason behind it because the universal binary will work fine on all the devices. I think it is a terrible policy decision by Apple because it means 3GS owners will not be able to enjoy all the benefits of their device (unless you submit a 3GS specific version, but I somehow doubt this will be accepted into the store). But, I digress.
I can't find anything about iPhone 2G in wikipedia: http://en.wikipedia.org/wiki/List_of_iPhone_and_iPod_Touch_models#iPhone Second Generation of iPhone is iPhone 3G