Android or iOS ? Which one is more efficient?

Android or iOS which one is more efficient ?



Well there are always some good and bad points for both but
for now here  we are comparing these on efficiency basis for programmers or for advanced users :)

so one of the biggest efficiencies in iOS compared to Android is memory management is

iOS uses a memory management technique called ‘automatic reference counting’ Android uses a technique called ‘garbage collection’

Garbage collection requires no special skill on the developer’s part. The developer doesn't have to do anything in particular. Periodically, the operating system stops running apps and cleans up unused memory.

It's easy, for developers, but it's extremely inefficient, and the more memory is used the less efficient it becomes. All other things being equal, a system that uses garbage collection requires 2–4 times as much RAM as a system using reference counting for the same performance from the same applications.

Reference counting is far more efficient but requires more discipline from developers. It's not “fire and forget” memory management; developers are responsible for memory management in their apps. Developers allocate memory for objects, and mark those objects as either being in use or being no longer necessary. When you're finished with an object in memory, it's your responsibility to mark it with a “release” tag, which tells the operating system you're no longer using it and that memory can be reclaimed.

Apple developed automatic reference counting (ARC) as part of their Objective-C (and later Swift) compilers. Automatic reference counting does what it says on the tin—it’s reference counting the developer doesn't have to pay attention to.

With automatic reference counting, your compiled code notices when an object is no longer being used, and automatically tags it with a “release” tag. This gives you the efficiency of reference counting without the hassle of having to do your own memory management.

That doesn't mean the developer can completely ignore memory. A clever developer bent on mischief can still screw things up even with automatic reference counting. If a developer creates two objects A and B, and A references B while B references A, they'll never be de-allocated even if nothing else references either one. Though if you're doing this, it might be time to re-consider your life choices.

0 comments

Do Not Miss

Career file for NFS- All blacklist opened