![]() It turned out that we could move this to a background thread quite easily and offload the main thread for this part.Īnother thing we noticed is the BucketHeaderView which is recalculating its height all the time although we didn’t do anything with it in the flow we’re testing. It’s pretty clear that our PHImageManager code is performing the worst as it takes 3.36 seconds from the total 11.16 seconds. Time Profile input filters to narrow down the results In combination with sorting on the Weight column, we can see exactly which methods should be optimized. Next up is the Invert Call Tree filter will make the top-level methods visible without having to click through each call tree. As you can see, the Heaviest Stack Trace overview is a lot cleaner now already. We start with Hide system libraries which will take away all lower-level symbols which are not in our control and can’t be optimized by us either way. This will also improve the heaviest stack trace view by hiding certain symbols. You can do the same by using click and drag on the part you want to investigate.Īt first, it looks quite unusable looking at the symbol names in the detail area:Īlthough the right side of the detail area shows us the Heaviest Stack Trace, we can use the Call Tree input filter to get an even better overview. In the previous example, you can see that the peaks in the graph are highlighted in blue. ![]() This shows the symbol names for the highlighted period. Using ⌘ + D will open up the Detail area if it’s not yet visible. Time Profiler main thread usage Identifying which part of the code can be optimized Scrolling down shows that our main thread is heavily used while the other threads are not so busy: The filter bar can be used to narrow down the overview and get a better insight into the used threads by selecting the Threads tab. ![]() Using filters to create an overview of threads The UI is blocked when there’s a lot of work happening on the main thread which is exactly the problem we’re experiencing in our Collect app. We first want to know how the main thread is used. This will launch your app in the selected device after which you can start your flow.Īfter you’ve finished the flow you want to improve you can stop recording and dive into the results. The Time Profiler is our starting point to get insights in which part of the code can be optimized.Ĭreating a new recording using the Time Profiler instrumentĪfter selecting the Time Profiler Instrument we can start a new recording by pressing the red button on the top left or by using ⌘ + R. In the Collect app performance example, we had the goal to speed up the flow of adding content to our app. The better this part in your app is, the better your app is performing. The Time Profiler instrument gives insights into the system’s CPUs and how effective multiple cores and threads are used. Using the Xcode Instruments Time Profile to investigate and improve the performance A physical device will show more realistic results and is therefore recommended to be used. You might end up in an issue which can be perfectly solved by one of the available instruments.Īlthough most of the instruments can be run on the simulator it’s not always recommended to do so. It is worth though to dive into the available instruments and to know which ones are available. Some of them, like the Game Performance instrument, is only valuable if you’re developing games. Each of them can be very valuable but they’re definitely not needed for every app. Xcode Instruments Overview Should I know how to use each instrument?Īn overview which shows 17 different instruments can be quite overwhelming. This will rebuild your product and opens the Xcode Instruments overview. You can access the instruments by using Product ➔ Profile from the Xcode menu for which the shortcut handle is ⌘ + I. Track down problems in your source code.It’s part of the Xcode toolset which also includes tools like Create ML and the Accessibility Inspector. Xcode Instruments is best described as a powerful and flexible performance-analysis and testing tool. Time to dive in and see how we improved this flow! Try it today!Īs you can see, the importing popup shows way longer in the old version while the final share sheet is being delayed a lot as well. Get more from your QA process Waldo automates the capture of quality debugging information for iOS developers during the QA process, so you don’t have to rely on a vague bug report to address issues in your build.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |