Wayback Machine
43 captures
03 Jul 2019 - 06 Mar 2026
May JUN Jul
12
2020 2021 2022
success
fail
About this capture
COLLECTED BY
Collection: GDELT Project
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20210612033133/https://developer.apple.com/videos/play/wwdc2019/417/

View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search Developer
Cancel
  • Apple Developer
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Limit search to

Quick Links

5 Quick Links

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos

Back to WWDC 2019

Streaming is available in most browsers,
and in the WWDC app.

  • Overview
  • Transcript
  • Improving Battery Life and Performance

    Learn about new ways to find and fix performance issues during daily development, beta testing, and public release on the App Store. Learn how to catch performance issues during daily development by measuring CPU, memory, and more in your XCTests. Discover how to find issues in the field during beta testing and public release using MetricKit. See how the Xcode Organizer now displays the most important metrics from your app aggregated from each version on the App Store.

    Resources

      • HD Video
      • SD Video
    • Presentation Slides (PDF)

    Related Videos

    WWDC 2021

    • Understand and eliminate hangs from your app

    WWDC 2020

    • Build scalable enterprise app suites
    • Why is my app getting killed?

    WWDC 2019

    • Advances in App Background Execution
    • Testing in Xcode
  • Download

    Thanks, everyone.

    Hi, how are you all doing? Welcome to WWDC. My name is Phillip Azar and I'm proud and happy to be able to share with you our talk on Improving Battery Life and Performance today. Your apps are the backbone of our software experience. They enable our users to do so many things and engage in so many experiences that without your apps, they could never do.

    And so you can imagine when your apps don't give good battery life and don't give good performance, this really disappoints your users. And so today we want to talk about a few things. We want to go over a set of tools that you can use that are both new and old to be able to optimize your application for battery life and performance. We want to go over a set of metrics that you can collect using those tools to be able to understand and quantify your application's impact on battery life and performance. And then I'm going to hand it over to my colleagues, who are going to go into these tools in more depth and go through some demos with you and show you how you can use these tools in your application to improve battery life and performance. And then I'll come back and we'll wrap it up. So, let's get started by talking about some tools. And in order to get started talking about tools, we need to talk about the development process and get all familiar with it. Development comes in phases. We've set it up into three different phases. Development and testing is the first phase. And at this stage, we're ideating and creating, and it's a very iterative process. We're either at our desks or maybe in the park, and we're really trying to understand what's going to make our app great.

    The next phase is called beta. After we've solidified the features in our application and we're ready for a test run, we give it to a few people, our beta users, and we try to get feedback. And then finally, when we're really proud of our application, when we've collected all the feedback, we're ready for primetime. It's public release. And this is when it's on the AppStore and available to millions of customers around the world.

    For battery life and performance, every step is critically important.

    We need to optimize at every step of the way to make sure that we're fixing bugs and making our experience as good as possible for our customers.

    And so with that in mind, before iOS 13 and Xcode 11, we offered a great set of tools for you to understand the impact of your application's battery life and performance.

    During development and testing, we have Xcode and all the tools it contains within it. Things like Instruments, the Energy Gauges, and Profiling tools.

    And then in beta, you can collect traces directly on beta devices using the developer settings and open those up in Instruments. And these are great for understanding problems that may not occur in your development environment but occur in the field such as when you don't have good cell reception. And then finally, the Xcode organizer gives you access to a powerful set of logs that you can see from your public release such as crashes and CPU energy reports. And these help you understand problems that are maybe specific to certain regions or specific to certain customers that may not have the same conditions as you. And so with these tools, we thought to ourselves long and hard over the last few years and wondered there are probably some gaps we can fill.

    And we spoke to many of you, both indirectly and directly, and the feedback that we got that was most of the gaps are in metrics. How do we quantify our application's battery life and performance? How do we make a decision about feature A versus feature B? Well today, as a part of Xcode 11 and iOS 13, I'm super happy to announce that we think we've solved that gap and we've bridged it with three new tools that you can start using today, starting with XCTest Metrics. This is the first new tool that we've shipped with Xcode 11 and this is going to allow you to collect directly within your XCTest performance and battery life metrics of measure blocks. This is going to give you some critical advantage when you're running XCTest and trying to understand at a very early stage what is the impact of a certain feature.

    The next is MetricKit, and this is a powerful new framework that we've built specifically for battery and performance metric collection. And this is going to give you metrics directly in your application and help you understand from all different users how your application is doing in the field.

    And then finally, we've beefed up the Xcode Organizer with Xcode Metrics Organizer. And this is going to be a high-level aggregated set of metrics that you're going to be able to look at directly in the Xcode Organizer without changing any code. And this is going to give you a great high-level overview of how your application is doing across the world for all your customers. And so looking back at this graph we just talked about, you can imagine all these tools fit really well in the development process, starting with XCTest Metrics during development and testing.

    Then, MetricKit, as you might imagine, falls really well into beta and public release when you may not have access to the devices that you're interested in collecting metrics about. And then finally, the Xcode Metrics Organizer beefs up your knowledge about the public release and helps you understand problems from primetime users. And so when you put these all together, we see that we have more metrics to quantify battery life and performance at every stage in development. And we think this is awesome. So, we've talked about these tools then a little bit and my colleagues will go into depth later about each of them. But right now I want to talk about the metrics that they provide.

    Because without these metrics, we wouldn't be able to quantify our impact. So, let's go through them now.

    This year we're providing two sets of metrics - battery and performance.

    Who would've guessed? Starting with the battery metrics, we're providing a really great set this year that are going to help you quantify your impact on battery life.

    Processing, location, display, networking, Bluetooth and accessory metrics, multimedia metrics, and camera metrics.

    This is a huge set of metrics that are really powerful but I want to go through a certain subset of these that we think are really important for everyone.

    Starting with the processing metrics.

    Processing metrics, as you might imagine, are things like CPU and GPU time, and we want you to use these metrics to quantify and understand the workload of your application. So for example, you can do things like find CPU spinners in areas where you might not expect them to be.

    Additionally, you can use, you can find unexpected rendering in your application using these metrics.

    And critically, we want you to use the processing metrics to compare the algorithmic efficiency of your features, just like we discussed before. If you have feature A and feature B, you can use these metrics to determine which one is better for battery life. Next up we have the location metrics. And these are going to be metrics that are going to help you understand and quantify your location usage, such as your cumulative usage, different accuracy buckets, and your background location usage. Use these metrics to understand your location usage, because it's a common pitfall when it comes to battery life. For example, you might find cases where you leave location running when you don't expect it to be running. Or you may use an accuracy bucket that's too powerful for the use case that you've implemented location for.