<!--
{
  "documentType" : "article",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/performance-tests",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Performance Tests"
}
-->

# Performance Tests

Gather metrics while running your code, and report a failure if the metrics become significantly worse than a baseline value.

## Topics

### Measuring Performance

  <doc://com.apple.documentation/documentation/Xcode/writing-and-running-performance-tests>

### Measurement Options

[`XCTMeasureOptions`](/documentation/XCTest/XCTMeasureOptions)

Options to control the gathering of performance measurements during tests.

### Measurement Metrics

[`XCTMetric`](/documentation/XCTest/XCTMetric)

A protocol that defines the methods that objects must provide when gathering metrics during performance tests.

[`XCTCPUMetric`](/documentation/XCTest/XCTCPUMetric)

A metric to record information about CPU activity during a performance test.

[`XCTClockMetric`](/documentation/XCTest/XCTClockMetric)

A metric to record the time that elapses during a performance test.

[`XCTHitchMetric`](/documentation/XCTest/XCTHitchMetric)

A metric to measure the number of hitches your UI encounters in a performance test.

[`XCTMemoryMetric`](/documentation/XCTest/XCTMemoryMetric)

A metric to record the physical memory that a performance test uses.

[`XCTOSSignpostMetric`](/documentation/XCTest/XCTOSSignpostMetric)

A metric to record the time that a performance test spends executing a signposted region of code.

[`XCTStorageMetric`](/documentation/XCTest/XCTStorageMetric)

A metric to record the amount of data that a performance test logically writes to storage.

[`XCTApplicationLaunchMetric`](/documentation/XCTest/XCTApplicationLaunchMetric)

A metric to record the application launch duration for a performance test.

### Measurements

[`XCTPerformanceMeasurement`](/documentation/XCTest/XCTPerformanceMeasurement)

A measurement from a single iteration of a performance test.

[`XCTPerformanceMeasurementTimestamp`](/documentation/XCTest/XCTPerformanceMeasurementTimestamp)

A point in time that captures the start or finish of a performance test iteration.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)