[25] Xcode Instruments - Fundamentals Flashcards

(52 cards)

1
Q

What is Xcode Instruments?

A

A performance analysis and debugging tool bundled with Xcode to profile apps in real time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you open Instruments from Xcode?

A

From Xcode’s menu: Product > Profile or press ⌘I.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a trace document in Instruments?

A

A file (.trace) that stores performance data collected during profiling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of Instruments templates?

A

They provide preconfigured sets of instruments for common tasks like Time Profiler, Leaks, Allocations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the Time Profiler instrument measure?

A

CPU usage by sampling the call stack at intervals to show where time is spent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the Allocations instrument track?

A

Memory allocations and deallocations to help identify memory usage patterns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the Leaks instrument detect?

A

Memory leaks caused by objects that were allocated but never freed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the Energy Log instrument analyze?

A

The app’s energy impact including CPU, network, and background usage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the Network instrument monitor?

A

Incoming and outgoing network requests and bandwidth usage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the Core Data instrument help with?

A

Tracks Core Data fetches, saves, faults, and cache misses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the File Activity instrument show?

A

File system read/write activity during runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the System Trace instrument do?

A

Captures detailed system-level events including threads, scheduling, and interrupts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the Metal System Trace instrument analyze?

A

Low-level GPU performance of Metal API calls.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the SceneKit instrument track?

A

Performance of SceneKit rendering calls and frame rates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does the Zombies instrument work?

A

Detects use-after-free errors by turning deallocated objects into “zombies.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the Swift Concurrency instrument help with?

A

Visualizes tasks, actors, and async/await execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the purpose of the Counters instrument?

A

Records custom counters that developers add to their code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the Signpost API?

A

A way to mark code regions for timing and debugging in Instruments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which framework provides the Signpost API?

A

os.signpost from the os framework.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a call tree in Instruments?

A

A hierarchical view of functions showing where execution time is spent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can you filter call trees?

A

By inverting, flattening, or focusing on specific threads or libraries.

22
Q

What is the difference between flat and inverted call trees?

A

Flat shows top-down calls, inverted shows bottom-up (hot spots at top).

23
Q

What is a hotspot in Instruments?

A

A function consuming significant CPU time.

24
Q

What is sampling in Time Profiler?

A

Periodic snapshots of the call stack to estimate CPU usage distribution.

25
How can you detect retain cycles?
Use Allocations + Leaks instruments and track objects that never deallocate.
26
What is the purpose of Heaps in Instruments?
To inspect objects currently in memory and their relationships.
27
How does the Points of Interest instrument work?
Logs app events (e.g., UI events, navigation) for correlation with performance.
28
How can you measure startup time in Instruments?
Use Time Profiler and filter for the main thread during launch.
29
What does the FPS track in Instruments?
Frames per second, to measure UI rendering performance.
30
What is the Activity Monitor instrument?
Displays real-time CPU, memory, disk, and network usage for the app.
31
What does the Logging instrument do?
Captures system and app logs for debugging alongside performance data.
32
What is the difference between Allocations and Leaks?
Allocations shows all memory usage; Leaks highlights unreleased memory.
33
What is a memory footprint?
The total amount of RAM your app is consuming.
34
How do you check thread contention?
Use System Trace or Time Profiler with thread filters.
35
What does the Instruments timeline show?
Graphical representation of events and metrics over time.
36
How do you drill into a function in Time Profiler?
Expand the call tree or double-click to view in the source code.
37
What is the Core Animation instrument for?
Tracks rendering issues like offscreen rendering, GPU usage, and dropped frames.
38
What is offscreen rendering?
When the GPU renders into a temporary buffer instead of directly to the screen.
39
How do you identify memory leaks visually?
Leaks instrument marks leaked objects in red.
40
What is a backtrace in Instruments?
A recorded stack trace showing the chain of function calls.
41
What does “sustained high energy impact” mean?
The app is consuming excessive CPU, GPU, or network resources.
42
What is the importance of testing on-device with Instruments?
Simulators don’t replicate real performance conditions accurately.
43
What is deferred deallocation?
Objects freed later by the system, which may confuse memory measurements.
44
How do you measure network latency?
Use the Network instrument to inspect request timings.
45
What is the purpose of track detail view?
Shows granular data for a selected portion of the timeline.
46
What are system intervals in Instruments?
Predefined measurement windows such as app launch or backgrounding.
47
What is the main advantage of signposts?
They allow correlation of custom app events with performance metrics.
48
What does the Automation instrument support?
UI testing by recording and replaying interactions.
49
What is the purpose of the Allocations “Mark Heap” feature?
Snapshots memory state at a point in time to compare before/after usage.
50
What does memory churn mean?
Frequent allocation and deallocation causing performance overhead.
51
What are live bytes in Allocations?
The total memory currently allocated and in use.
52
Why should you profile in Release mode?
Optimizations in Release mode affect performance differently than Debug builds.