Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2026 SwiftDeveloper Tools

WWDC26 · 27 min · Swift / Developer Tools

Profile, fix, and verify: Improve app responsiveness with Instruments

Tackle app responsiveness issues with a clear workflow. Explore the Swift Concurrency instrument, Time Profiler, and System Trace to pinpoint bottlenecks. Discover how to use top functions and run comparisons to measure your improvements and confirm your fixes. And learn about other enhancements in Instruments which make each iteration of this cycle faster than ever, so you can deliver a smoother user experience in less time.

Watch at developer.apple.com ↗

Transcript all transcripts

Chapters

Code shown on screen · 9 snippets

Add signpost interval around Lasso Selection swift · at 5:41 ↗
// 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!)
}
Existentials swift · at 12:11 ↗
// Existentials

protocol Foo { }

struct TypeA: Foo { }
struct TypeB: Foo { }

func bar(_ foo: any Foo) {

}
Concrete Types swift · at 12:39 ↗
// Concrete types

protocol Foo { }

struct TypeA: Foo { }
struct TypeB: Foo { }

func bar(_ a: TypeA) {

}

func bar(_ b: TypeB) {

}
Concrete Types + Generics swift · at 12:46 ↗
// 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) {

}
Concrete Types + Generics + Enums swift · at 12:49 ↗
// 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) {

}
Thumbnail Rendering swift · at 18:24 ↗
// 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
Thumbnail Rendering Off Main Actor swift · at 18:29 ↗
// 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
File Saving swift · at 24:12 ↗
// 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)
File Saving off Main thread swift · at 24:25 ↗
// 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)
}

Resources