View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Ultimate application performance survival guide

    Performance optimization can seem like a daunting task — with many metrics to track and tools to use. Fear not: Our survival guide to app performance is here to help you understand tooling, metrics, and paradigms that can help smooth your development process and contribute to a great experience for people using your app.

    Ressources

    • Analyzing the performance of your shipping app
    • Improving app responsiveness
    • MetricKit
    • App Store Connect API
    • XCTest
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC23

    • Optimize app power and performance for spatial computing

    WWDC21

    • Detect and diagnose memory issues
    • Diagnose Power and Performance regressions in your app
    • Triage TestFlight crashes in Xcode Organizer
    • Understand and eliminate hangs from your app

    WWDC20

    • Diagnose performance issues with the Xcode Organizer
    • Eliminate animation hitches with XCTest
    • Identify trends with the Power and Performance API
    • What's new in MetricKit

    Tech Talks

    • Explore UI animation hitches and the render loop

    WWDC19

    • Getting Started with Instruments
  • Rechercher dans cette vidéo…
    • 5:46 - Using MetricKit

      class AppMetrics: MXMetricManagerSubscriber {
      	init() {
      		let shared = MXMetricManager.shared
      		shared.add(self)
      	}
      
      	deinit {
      		let shared = MXMetricManager.shared
      		shared.remove(self)
      	}
      
      	// Receive daily metrics
      	func didReceive(_ payloads: [MXMetricPayload]) {
      		// Process metrics
      	}
      
      	// Receive diagnostics
      	func didReceive(_ payloads: [MXDiagnosticPayload]) {
      		// Process metrics
      	}
      }
    • 10:29 - Testing Scroll performance

      func testScrollingAnimationPerformance() throws {
              
          app.launch()
          app.staticTexts["Meal Planner"].tap()
          let foodCollection = app.collectionViews.firstMatch
      
          let measureOptions = XCTMeasureOptions()
          measureOptions.invocationOptions = [.manuallyStop]
              
          measure(metrics: [XCTOSSignpostMetric.scrollDecelerationMetric],
          options: measureOptions) {
              foodCollection.swipeUp(velocity: .fast)
              stopMeasuring()
              foodCollection.swipeDown(velocity: .fast)
          }
      }
    • 11:53 - Using mxSignpostAnimationIntervalBegin

      func startAnimating() {
      	// Mark the beginning of animations
      	mxSignpostAnimationIntervalBegin(
      		log: MXMetricManager.makeLogHandle(category: "animation_telemetry"), 
      		name: "custom_animation”)
      	}
      
      	func animationDidComplete() {
      	// Mark the end of the animation to receive the collected hitch rate telemetry
      	mxSignpost(OSSignpostType.end, 
      		log: MXMetricManager.makeLogHandle(category: "animation_telemetry"), 
      		name: "custom_animation")
      }
    • 13:51 - Using XCTest to Measure Disk Usage

      // Example performance XCTest
      
      func testSaveMeal() {
      	let app = XCUIApplication()
      	let options = XCTMeasureOptions()
      	options.invocationOptions = [.manuallyStart]
      
      	measure(metrics: [XCTStorageMetric(application: app)], options: options) {
      		app.launch()
      		startMeasuring()
      
      		let firstCell = app.cells.firstMatch
      		firstCell.buttons["Save meal"].firstMatch.tap()
      
      		let savedButton = firstCell.buttons["Saved"].firstMatch
      		XCTAssertTrue(savedButton.waitForExistence(timeout: 2))
      	}
      }
    • 21:19 - Collect memory telemetry

      // Collect memory telemetry
      
      func saveAppAssets() {
      	mxSignpost(OSSignpostType.begin, 
      		log: MXMetricManager.makeLogHandle(category: "memory_telemetry"), 
      		name: "custom_memory")
      
      	// save app metadata
      
      	mxSignpost(OSSignpostType.end, 
      		log: MXMetricManager.makeLogHandle(category: "memory_telemetry"), 
      		name: "custom_memory")
      }

Developer Footer

  • Vidéos
  • WWDC21
  • Ultimate application performance survival guide
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines