Skip to content

Commit 198ef82

Browse files
billyvgryan953lizokmgetsantry[bot]
authored
Add Replay performance overhead numbers and messaging (#7451)
Add a bit more details (and hard numbers) for performance overhead of Replay. Closes #6297 --------- Co-authored-by: Ryan Albrecht <ryan.albrecht@sentry.io> Co-authored-by: Liza Mock <liza.mock@sentry.io> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent 17565c8 commit 198ef82

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

src/docs/product/session-replay/performance-overhead.mdx

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,42 @@ Session Replay works by observing and recording changes to your web application'
1010

1111
**For most web applications, the performance overhead of our client SDK is imperceptible to end-users.**
1212

13-
Below, you can learn more about the individual measures we've taken to ensure smooth performance of our Session Replay SDK.
13+
Performance overhead depends on the complexity of your application. Applications with a large DOM and numerous DOM node mutations will have a higher overhead than a more simpler and mostly static site. The only way to get accurate overhead metrics is to measure it yourself. We have written a blog post, [Measuring Session Replay Overhead](https://sentry.engineering/blog/measuring-session-replay-overhead), that outlines how you can get started measuring overhead of Replay on your applications without deploying to production. We measured the overhead of the Replay SDK on Sentry's web UI using the methodology from the blog. Here are the results (median values are shown):
1414

15-
## How is Session Replay optimized?
15+
| Metric | Without Sentry | Sentry SDK only | Sentry + Replay SDK |
16+
| -------------------------------- | -------------- | --------------- | ------------------- |
17+
| Largest Contentful Paint (LCP)\* | 1336.05 ms | 1896.80 ms | 1643.00 ms |
18+
| Cumulative Layout Shift (CLS) | 0.39 ms | 0.39 ms | 0.39 ms |
19+
| First Input Delay (FID) | 1.30 ms | 1.30 ms | 1.60 ms |
20+
| Total Blocking Time (TBT) | 2629.00 ms | 2742.00 ms | 3267.50 ms |
21+
| Average Memory | 118.79 MB | 113.79 MB | 132.05 MB |
22+
| Max Memory | 311.4 MB | 316.57 MB | 334.82 MB |
23+
| Network Upload | 21 B | 3.79 KB | 392.98 KB |
24+
| Network Download | 7.11 MB | 6.93 MB | 6.87 MB |
25+
26+
<p>
27+
<sub>
28+
* The standard deviation for LCP was 386, 511, and 354 ms, respectively.
29+
This means that the LCP values are quite spread out and explains why the
30+
Sentry standalone LCP value is higher than the Sentry with Replay value.
31+
</sub>
32+
</p>
33+
34+
The benchmarks were run on an Apple M1 MacBook Pro against a remote preview server and a remote API backend with 100 iterations. The scenario can be summarized as loading Sentry, navigating to Discover, adding 4 columns, waiting for results, adding another column, and finally waiting for results a second time.
35+
36+
The benchmark test was a strenuous recording scenario (the Discover data table is one of our most complex, in regards to DOM nodes and mutations). A simpler scenario consisting of navigation to four different "Settings" pages was also ran and produced an increase of ~100 ms of total JS blocking time.
37+
38+
<Note>
39+
There is a known performance issue that happens when replays with many DOM
40+
mutations are recorded. It generally occurs when rendering large data grids.
41+
We're working on a fix, but in the meantime we recommend you{" "}
42+
<Link to="https://docs.sentry.io/platforms/javascript/session-replay/privacy/#blocking">
43+
use the blocking feature
44+
</Link>
45+
to avoid recording large mutations which can degrade performance for your customers.
46+
</Note>
47+
48+
## How Is Session Replay Optimized?
1649

1750
Sentry's Session Replay SDK takes several measures to avoid negatively impacting the performance of the page on which it's running:
1851

0 commit comments

Comments
 (0)