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
  • Résumé
  • Code
  • Profilez, corrigez et vérifiez : améliorez la réactivité des apps avec Instruments

    Résolvez les problèmes de réactivité des apps grâce à un processus clair. Explorez l'instrument Swift Concurrency, Time Profiler et System Trace pour identifier les goulots d'étranglement. Découvrez comment tirer parti des fonctions clés et effectuer des comparaisons pour mesurer vos améliorations et valider vos corrections. Découvrez également d'autres améliorations apportées à Instruments qui accélèrent plus que jamais chaque itération de ce cycle, ce qui vous permet d'offrir une expérience utilisateur plus fluide en moins de temps.

    Chapitres

    • 0:00 - Introduction
    • 1:12 - Diagnostic flow
    • 7:06 - Sampling data visualization
    • 16:01 - Execution contention
    • 20:29 - System blocking
    • 26:07 - Next steps

    Ressources

    • Analyzing CPU profiles with call tree views
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC26

    • Nouveautés de Xcode 27

    WWDC25

    • Adoptez la concurrence avec Swift
    • Optimiser les performances du processeur avec Instruments

    WWDC23

    • Analyze hangs with Instruments

    WWDC22

    • Embrace Swift generics
  • Rechercher dans cette vidéo…
    • 5:41 - Add signpost interval around Lasso Selection

      // Add signpost interval around Lasso Selection
      
      import os.signpost
      
      let signposter = OSSignposter(subsystem: “Demo App", category: .pointsOfInterest)
      var lassoIntervalState: OSSignpostIntervalState? = nil
      
      func lassoSelectionUpdated() {
          lassoIntervalState = signposter.beginInterval("Lasso Selection")
          // Update selection in canvas…
      }
      
      func lassoSelectionEnded() {
          // Finalize lasso selection...
          signposter.endInterval("Lasso Selection", lassoIntervalState!)
      }
    • 12:11 - Existentials

      // Existentials
      
      protocol Foo { }
      
      struct TypeA: Foo { }
      struct TypeB: Foo { }
      
      func bar(_ foo: any Foo) {
      
      }
    • 12:39 - Concrete Types

      // Concrete types
      
      protocol Foo { }
      
      struct TypeA: Foo { }
      struct TypeB: Foo { }
      
      func bar(_ a: TypeA) {
      
      }
      
      func bar(_ b: TypeB) {
      
      }
    • 12:46 - Concrete Types + Generics

      // Concrete types
      
      protocol Foo { }
      
      struct TypeA: Foo { }
      struct TypeB: Foo { }
      
      func bar(_ a: TypeA) {
      
      }
      
      func bar(_ b: TypeB) {
      
      }
      
      // Generics
      
      protocol Foo { }
      
      struct TypeA: Foo { }
      struct TypeB: Foo { }
      
      func bar<T: Foo>(_ generic: T) {
      
      }
    • 12:49 - Concrete Types + Generics + Enums

      // Concrete types
      
      protocol Foo { }
      
      struct TypeA: Foo { }
      struct TypeB: Foo { }
      
      func bar(_ a: TypeA) {
      
      }
      
      func bar(_ b: TypeB) {
      
      }
      
      // Generics
      
      protocol Foo { }
      
      struct TypeA: Foo { }
      struct TypeB: Foo { }
      
      func bar<T: Foo>(_ generic: T) {
      
      }
      
      // Enums
      
      enum Foo {
          case a(TypeA)
          case b(TypeB)
      }
      
      struct TypeA { }
      struct TypeB { }
      
      func bar(_ enum: Foo) {
      
      }
    • 18:24 - Thumbnail Rendering

      // Thumbnail rendering
      
      let drawingData = note.drawingData
      let canvasImages = note.decodeCanvas()
      thumbnail = await Task(name: "Render Thumbnail") {
          await renderThumbnail(drawingData: drawingData, canvasImages: canvasImages, size: CGSize(width: 300, height: 240))
      }.value
    • 18:29 - Thumbnail Rendering Off Main Actor

      // Thumbnail rendering off Main Actor
      
      let drawingData = note.drawingData
      let canvasImages = note.decodeCanvas()
      thumbnail = await Task(name: "Render Thumbnail") { @concurrent in
          await renderThumbnail(drawingData: drawingData, canvasImages: canvasImages, size: CGSize(width: 300, height: 240))
      }.value
    • 24:12 - File Saving

      // File saving
      
      let encoder = PropertyListEncoder()
      encoder.outputFormat = .binary
      guard let data = try? encoder.encode(snapshots) else { return }
      let id = signposter.beginInterval("Writing To File")
      try? data.write(to: fileURL, options: .atomic)
      signposter.endInterval("Writing To File", id)
    • 24:25 - File Saving off Main thread

      // File saving
      
      Task { @concurrent in
      	let encoder = PropertyListEncoder()
      	encoder.outputFormat = .binary
      	guard let data = try? encoder.encode(snapshots) else { return }
      	let id = signposter.beginInterval("Writing To File")
      	try? data.write(to: fileURL, options: .atomic)
      	signposter.endInterval("Writing To File", id)
      }
    • 0:00 - Introduction
    • Overview of how Instruments 27 helps developers understand and optimize app responsiveness across the software stack abstraction layers.

    • 1:12 - Diagnostic flow
    • Learn the four-step mental model — CPU saturation, sampling data visualization, execution contention, and system blocking — for systematically triaging hangs and frame drops.

    • 7:06 - Sampling data visualization
    • Explore how Instruments' Call Tree, Flame Graph, and the new Top Functions mode transform raw CPU samples into actionable views for identifying performance bottlenecks.

    • 16:01 - Execution contention
    • Discover how the Swift Executors instrument reveals when render-thumbnail tasks saturate the Main Actor, and how adding the @concurrent attribute moves work off the main thread to resolve UI hangs.

    • 20:29 - System blocking
    • Use System Trace and the new Inspector panel to diagnose low-CPU hangs caused by synchronous file I/O blocking the main thread, and learn to fix them by moving the work to a background Swift task.

    • 26:07 - Next steps
    • Key takeaways on matching the right Instruments template to each class of performance problem, plus links to related sessions on CPU optimization, Swift Concurrency, and hang analysis.

Developer Footer

  • Vidéos
  • WWDC26
  • Profilez, corrigez et vérifiez : améliorez la réactivité des apps avec Instruments
  • 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