What is Xcode Instruments?
A performance analysis and debugging tool bundled with Xcode to profile apps in real time.
How do you open Instruments from Xcode?
From Xcode’s menu: Product > Profile or press ⌘I.
What is a trace document in Instruments?
A file (.trace) that stores performance data collected during profiling.
What is the purpose of Instruments templates?
They provide preconfigured sets of instruments for common tasks like Time Profiler, Leaks, Allocations.
What does the Time Profiler instrument measure?
CPU usage by sampling the call stack at intervals to show where time is spent.
What does the Allocations instrument track?
Memory allocations and deallocations to help identify memory usage patterns.
What does the Leaks instrument detect?
Memory leaks caused by objects that were allocated but never freed.
What does the Energy Log instrument analyze?
The app’s energy impact including CPU, network, and background usage.
What does the Network instrument monitor?
Incoming and outgoing network requests and bandwidth usage.
What does the Core Data instrument help with?
Tracks Core Data fetches, saves, faults, and cache misses.
What does the File Activity instrument show?
File system read/write activity during runtime.
What does the System Trace instrument do?
Captures detailed system-level events including threads, scheduling, and interrupts.
What does the Metal System Trace instrument analyze?
Low-level GPU performance of Metal API calls.
What does the SceneKit instrument track?
Performance of SceneKit rendering calls and frame rates.
How does the Zombies instrument work?
Detects use-after-free errors by turning deallocated objects into “zombies.”
What does the Swift Concurrency instrument help with?
Visualizes tasks, actors, and async/await execution.
What is the purpose of the Counters instrument?
Records custom counters that developers add to their code.
What is the Signpost API?
A way to mark code regions for timing and debugging in Instruments.
Which framework provides the Signpost API?
os.signpost from the os framework.
What is a call tree in Instruments?
A hierarchical view of functions showing where execution time is spent.
How can you filter call trees?
By inverting, flattening, or focusing on specific threads or libraries.
What is the difference between flat and inverted call trees?
Flat shows top-down calls, inverted shows bottom-up (hot spots at top).
What is a hotspot in Instruments?
A function consuming significant CPU time.
What is sampling in Time Profiler?
Periodic snapshots of the call stack to estimate CPU usage distribution.