Skip to content

Commit 2417118

Browse files
authored
feat(apple): add new options for Session Replay (#12997)
1 parent e209a4e commit 2417118

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

docs/platforms/apple/guides/ios/session-replay/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ SentrySDK.start(configureOptions: { options in
4040

4141
options.sessionReplay.onErrorSampleRate = 1.0
4242
options.sessionReplay.sessionSampleRate = 0.1
43+
44+
// We recommend the ~5x more performant experimental view renderer
45+
options.sessionReplay.enableExperimentalViewRenderer = true
4346
})
4447
```
4548

docs/platforms/apple/guides/ios/session-replay/performance-overhead.mdx

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,26 @@ You can learn more about the various performance overhead optimizations implemen
1111

1212
## Benchmarking the iOS Replay SDK
1313

14-
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:
14+
The Pocket Casts app offers a diverse mix of components making it an ideal candidate for testing. Here's how the benchmarks were conducted:
15+
1516
- **Configuration:** Full masking was enabled, and optimized release builds were used.
1617
- **User Flow:** The same flow was executed 10 times to ensure consistency.
1718
- **Real-World Representation:** This approach closely mirrors performance in real-world scenarios.
1819

1920
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).
2021

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

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

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

3435
## Reducing Performance Overhead
3536

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

5152
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:
5253

53-
```kotlin
54+
```swift
5455
SentrySDK.start(configureOptions: { options in
5556
options.dsn = "___PUBLIC_DSN___"
5657
options.debug = true
@@ -59,3 +60,21 @@ SentrySDK.start(configureOptions: { options in
5960
options.sessionReplay.sessionSampleRate = if isLowEnd() { 0.0 } else { 0.1 }
6061
})
6162
```
63+
64+
### Enable Experimental View Renderer
65+
66+
<Alert>
67+
In case you are noticing issues with the experimental view renderer, please
68+
report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).
69+
</Alert>
70+
71+
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.
72+
73+
While we do recommend the new view renderer, it's currently considered an experimental feature to further evaluate its stability.
74+
After the evaluation phase we are going to enable it by default.
75+
76+
```swift
77+
SentrySDK.start(configureOptions: { options in
78+
options.sessionReplay.enableExperimentalViewRenderer = true
79+
})
80+
```

0 commit comments

Comments
 (0)