Due to the needs of the project, some models with low graphics cards used in the recent death of drawRect drawing, after a series of track is found high usage of CPU in the more than 100% once…
Direct figure, figure 1 is the CPU occupancy for the first time; figure two is the CPU occupation that triggers an operation
, figure 1
, figure 2
Then came the question? How do you know what is going on here? Have to say a big weapon Xcode debugging: Instruments Figure 2 can click on the top right of the Profile Instruments into memory monitoring and debugging interface can also be Xcode -> Product -> Profile-> Time; Profile or CMD + I into
After click enter, sit above the red button to start the operation, then we can see the occupancy of CPU real time. And, we can according to below the call tree to find out about the arch-criminal sequential memory consumption!
is expanded step by step
This, we have found arch-criminal CPU occupation. Then the view function code, optimize the code. If this part of the code optimization, CPU occupancy remains high. Or, you have not solved this problem, or there are other effects of CPU occupied place. If the latter, you can to the above, this arch-criminal occupied CPU were analyzed to find out…
Baby also can only help you to it, I am just a small development. On the way of learning to fill the pit, pit fall, drop dead, Jack Bauer is me….