Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/platforms/apple/guides/ios/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ SentrySDK.start(configureOptions: { options in

options.sessionReplay.onErrorSampleRate = 1.0
options.sessionReplay.sessionSampleRate = 0.1

// We recommend the ~5x more performant experimental view renderer
options.sessionReplay.enableExperimentalViewRenderer = true
})
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ You can learn more about the various performance overhead optimizations implemen

## Benchmarking the iOS Replay SDK

The Pocket Casts app offers a diverse mix of components, including Fragments, Activities, and Jetpack Compose screens, making it an ideal candidate for testing. Here's how the benchmarks were conducted:
The Pocket Casts app offers a diverse mix of components making it an ideal candidate for testing. Here's how the benchmarks were conducted:

- **Configuration:** Full masking was enabled, and optimized release builds were used.
- **User Flow:** The same flow was executed 10 times to ensure consistency.
- **Real-World Representation:** This approach closely mirrors performance in real-world scenarios.

The benchmarks were run on an iPhone 14 Pro. Note that active Session Replay recording can introduce slow frames on older lower-end iOS devices (for example iPhone 8).

### Results
Below are the results of the benchmarking tests, presented as median values to reflect typical overhead.

Below are the results of the benchmarking tests, presented as median values to reflect typical overhead.

| Metric | Sentry SDK only | Sentry + Replay SDK |
| -------------------------------- | --------------- | ------------------- |
| FPS | 55 fps | 53 fps |
| Memory | 102 MB | 121 MB |
| CPU | 4% | 13% |
| App Startup Time (Cold) | 1264.80 ms | 1265 ms |
| Main Thread Time | n/a | 43ms |
| Network Bandwidth | n/a | 10 KB/s of recording|
| Metric | Sentry SDK only | Sentry + Replay SDK |
| ----------------------- | --------------- | -------------------- |
| FPS | 55 fps | 53 fps |
| Memory | 102 MB | 121 MB |
| CPU | 4% | 13% |
| App Startup Time (Cold) | 1264.80 ms | 1265 ms |
| Main Thread Time | n/a | 43ms |
| Network Bandwidth | n/a | 10 KB/s of recording |

## Reducing Performance Overhead

Expand All @@ -50,7 +51,7 @@ SentrySDK.start(configureOptions: { options in

If the Replay SDK causes performance issues on lower-end devices (for example, [this](https://github.com/getsentry/relay/blob/695b459e03481f7d799f07b2b901b140e5d5753d/relay-event-schema/src/protocol/device_class.rs#L21-L37) is how Sentry determines the device class), you can disable it specifically for those devices:

```kotlin
```swift
SentrySDK.start(configureOptions: { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true
Expand All @@ -59,3 +60,21 @@ SentrySDK.start(configureOptions: { options in
options.sessionReplay.sessionSampleRate = if isLowEnd() { 0.0 } else { 0.1 }
})
```

### Enable Experimental View Renderer

<Alert>
In case you are noticing issues with the experimental view renderer, please
report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).
</Alert>

Starting with v8.47.0 you can enable the up-to-5x-faster new view renderer, reducing the impact of Session Replay on the main thread and potential frame drops.

While we do recommend the new view renderer, it's currently considered an experimental feature to further evaluate its stability.
After the evaluation phase we are going to enable it by default.

```swift
SentrySDK.start(configureOptions: { options in
options.sessionReplay.enableExperimentalViewRenderer = true
})
```