iOS Simulator CPU load - ios

When looking at the performance of an app on the simulator, I can see the CPU load.
Is the CPU figure a simulated load on a real device, or is it the load on the Mac's CPU from running the simulator?
I understand that neither would tell me much about the real performance on device, and I do regularly test on device. But I was wondering if anyone know, or if there's any information about what this number means.

No the iOS simulator is not replicating an iOS device in terms of performance. The numbers are simply the load on the Mac's CPU and are not a good indicator of performance on a real ARM iOS device.
The simulator numbers may be ok for comparing relative performance of some operations, but you should be sure to test on device, especially when using other hardware features such as the GPU.

Related

Is the iPhone Simulator actually as "slow" as device itself

I wanted to know whether the iPhone Simulator in XCode "really" emulates the device hardware.
So when deploying to iPhone 4s Simulator, will my app actually be "as slow as on a real iPhone 4S device" and when using an iPhone 6 Simulator, will it be as fast as on a real device?
The simulator does a really lousy job of indicating app performance. In fact it doesn't try.
For most things the simulator is much, much faster than an iOS device. It runs your code on an x86 processor, which is much faster than the ARM and has many times more memory. (It also actually links again OXS frameworks, not iOS frameworks. There is glue code in the simulator that makes it work with iOS code, but it's not perfect.)
However, some things, like Core Image filters and OpenGL graphics, are actually slower on the simulator than on a real iOS device.
The bottom line is that you can't really tell ANYTHING about your app's performance from the simulator, and shouldn't try. You can do basic development on the sim, but when it comes time to test performance, use real devices, and make sure to test on the oldest/slowest device your app supports (usually an iPhone 4s or iPad 2).
You also can't test memory usage on the simulator. A program that will run out of memory and crash on an iOS device may run just fine on the simulator.
The Simulator is a useful tool, and it should not be the only way you
test an app. Because the Simulator is an app running on a Mac, it has
access to the computer’s resources, including the CPU, memory, and
network connection. All of these resources are likely to be faster
than those found on a mobile device. As a result, the simulator is not
an accurate test of an app’s performance, memory usage, and networking
speed.
Source

CPU Usage in Xcode

I'm fairly new to Xcode and I was wondering what the CPU bars represent when you run your iOS app in the simulator.
Do the CPU bars represent how much processing power the simulator is using on my Mac or does it represent how much it would use if it would run on the latest iOS device?
It is how much CPU it is using on the Mac. The simulator does not reflect in any way the performance of a device. You will need to debug on a device to get device performance data.
Source

Is there any way to set simulator to work on limited memory? [duplicate]

This question already has answers here:
Is there a way to set the amount of memory available in the iPhone Simulator?
(4 answers)
Closed 8 years ago.
As we all know that simulator has more memory than devices. Generally for unit testing every developer use simulator before test project on device but sometimes in the case of unavailability of device, Is this possible to set simulator work on the limited memory?
For example is there any option in tool bar to set simulator's memory on 16GB/ 32GB memory so that it will work in the same way an iPad having 16Gb memory works if we set memory limitation to 16GB.
I guess this will solve your question :- Is there a way to set the amount of memory available in the iPhone Simulator?Update(Copying the content of below link):- https://discussions.apple.com/thread/3870841?tstart=0
Not possible. The simulator is an OS X application and thus you have no control over memory allocation. For details, read the part about OS X memory management here:
https://developer.apple.com/library/ios/#documentation/Performance/Conceptual/ManagingMemory/ManagingMemory.html#//apple_ref/doc/uid/10000160i.
Update 2:-Even though iOS Simulator is a useful tool, never make it the only way you test an app. Because iOS Simulator is an app running on a Mac, it has access to the computer’s memory, which is much greater than the memory found on a device. As a result of the increased memory, iOS Simulator is not an accurate test of an app’s memory usage. For this same reason, you should always test the performance of your app’s user interface (UI) on a device. In iOS Simulator, your app’s UI may appear to run both faster and smoother than on a device.
Reference link:- https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/TestingontheiOSSimulator/TestingontheiOSSimulator.html

iOS and Cocos2d: my app REALLY slow on simulator but is FINE on device

..I am wondering whether there is some setting I should change to get my iOS 5.0 app running fine on an iPhone IOS 5.0 simulator. It runs at only 12fps instead on my device runs at 60fps. Any help? I would have expected the simulator to work fine..
I am using XCode 4.3 and Mac OS X 10.7.3.
Simulator performance is completely and utterly irrelevant. The Simulator runs on your Mac's CPU, that's multiple times faster than the fastest iOS device. The Simulator does however not use hardware graphics accelerations, so it's easily maxed out even though your Mac is so much faster. Lastly, which of your app's users are going to run your app on the Simulator? Answer: no one!
That said, there is still reason to be alarmed. You get 60 fps on the device, that's great. But which device? If it is an iPhone 4S or iPad 3, that device is a lot faster than older devices like iPhone 3GS (or even older yet) or iPad 1. So depending on which device is the oldes device you're developing for, you might still have a problem. Try to find or borrow such a device, and test it on that oldest-supported device, and do test only with a release build.
Consider the facts:
Simulator performance sucks
Retina Simulator performance sucks even more
iPad Retina Simulator performance is beyond good & android
You're most likely the only person ever to run your app in the iOS Simulator
Therefore:
Simulator performance is irrelevant
Simulator performance can not be compared to device performance
The Simulator is for quicker testing of your app's business logic, nothing else. Not even Samsung copied it.
In addition:
Debug build performance is largely irrelevant. At least verify performance measurements in release builds.
Test on oldest supported device. Otherwise you have no way of knowing whether the previous generation device from the device you're testing on may still render 60 fps or only renders 20 fps. That's quite possible.
Lastly, to answer your actual question: the only thing you could do is to make sure you run the standard (ie non-Retina) resolution Simulator. There's really nothing else you can do besides getting a Mac with a (much) faster CPU.
For graphics, par for course. Dont use simulator for any user experience validation, but stick to devices. Dont waste a minute trying to tweak your workstation settings or looking for ways to improve simulator performance. In any event, your are trying to deploy to devices after all no ?
Some functions work faster on simulator (depending on your workstation of course), like data or computation intensive functions. As always, benchmark on your devices, dont be fooled by 'suitable' simulator performance.

"live bytes" different on simulator versus device

I have a program that is showing, in the allocations instrument, approx. 72 MB of "live bytes" but when I run the profiling on my iPod touch, it shows 6 MB. I don't understand why the vast difference. Can anybody please explain this?
Keep in mind that the iOS Simulator is a simulator, not an emulator.
The iOS Simulator works by compiling your iOS application to x86 code, and linking it against a set of system frameworks which simulate their iOS equivalents on a desktop computer. These frameworks are, of necessity, not identical to those that you'd find on "real" iOS -- they are, after all, compiled for a different CPU architecture, and are "talking to" desktop hardware, not a handheld device.
Knowing this, it should be understandable that some aspects of application performance may be radically different on the Simulator than on a real device. Keep this in mind, and test your code early and often on real hardware!

Resources