Why optimize iOS performance?

For a better user experience, of course


Performance tuning can be tricky:

  • There are risks

If the program can run, don’t move

  • Time consuming

Business time is tight, so is “refactoring” time

  • Optimization is complicated

My mind went blank. Most people can’t handle it

  • Code optimization, what’s better than a big performance boost in hardware

Hardware is cheap and engineers’ time is expensive


Apple’s hardware has certainly improved over the years


2013

When the iPhone 5S with the A7 chip was released in 2013, it far outperformed the prototype, with CPU processing 40 times faster and graphics 56 times faster.

Resource link: Mac Culture website

In 2016, the iPhone 7 was released with 120 times better performance.


2017

In terms of specific performance, the A11 BIONIC boasts two performance cores that are 25% faster than the previous A10. The four efficiency cores are 70% higher than the A10. Overall CPU performance is 70% better than the A10.

Source: What’s behind the iPhone X

Significant hardware improvement

The 2017 fruit machine, compared with the performance of 2007, improved 200 times.

but

  • Augmented reality, AR, is very power-hungry

  • Slo-mo at 240 FPS 1080p is slow motion, slow motion, and battery killer

  • And Animoji on the iPhone X.

.

Not everyone’s iPhone is the latest model with an advanced chip like the A11.


Screen snapshot 2018-04-26 PM 2.45.33.png

Link: iPhone device market


Therefore, improving the performance of APP generally starts from three directions:

  • No flash back includes applications that will not be killed by the system’s daemon, watchdog. In one case, the app uses too much memory and is killed by the system.

  • Smooth interaction

  • Save electricity


Measurement of app performance, dare to ask where to go?

A pat on the head is usually not constructive.

By using tools to measure the performance of APP, we can know whether to improve and where to change.

Improvement. Measure it again, see how it goes.


Measuring tools and methods are generally available

  • NSLog/print method
  • Debug artifact Instruments
  • Measure () method in THE XCTest framework (those of you who have written unit tests know this)


Hard work!


This is a brief compilation of CocoaHeads Shanghai No. 35, developer Marco Scheurer of Sente. Ch

See the GitHub link for information