diff --git a/docs/platforms/apple/guides/ios/session-replay/index.mdx b/docs/platforms/apple/guides/ios/session-replay/index.mdx index 13aa792893a07..1964bbd54d2a9 100644 --- a/docs/platforms/apple/guides/ios/session-replay/index.mdx +++ b/docs/platforms/apple/guides/ios/session-replay/index.mdx @@ -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 }) ``` diff --git a/docs/platforms/apple/guides/ios/session-replay/performance-overhead.mdx b/docs/platforms/apple/guides/ios/session-replay/performance-overhead.mdx index 854e56cb7aabb..4880b9f1d9b1f 100644 --- a/docs/platforms/apple/guides/ios/session-replay/performance-overhead.mdx +++ b/docs/platforms/apple/guides/ios/session-replay/performance-overhead.mdx @@ -11,7 +11,8 @@ 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. @@ -19,17 +20,17 @@ The Pocket Casts app offers a diverse mix of components, including Fragments, Ac 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 @@ -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 @@ -59,3 +60,21 @@ SentrySDK.start(configureOptions: { options in options.sessionReplay.sessionSampleRate = if isLowEnd() { 0.0 } else { 0.1 } }) ``` + +### Enable Experimental View Renderer + + + In case you are noticing issues with the experimental view renderer, please + report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa). + + +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 +}) +```