Learn
SDK Performance

SDK Performance

Traceway's SDKs are built to stay out of your app's way. This page says what they do on your main thread, the limits they keep to, and what they cost, measured on the same app with and without the SDK.

The short version

  • Replay works off your main thread. On Android, iOS and Flutter the SDK reads the screen once per capture on the main (UI) thread, a read of about 1–2 ms on Android, 2–4 ms in Flutter and 8 ms on iOS on our test machines, and builds, compresses and uploads the frame on a thread of its own. In the browser, rrweb records page changes as they happen, and picture copies and compression run in a Web Worker.
  • Hard limits. At most 5 captures a second, only when something on screen changed, and a tenth of the main thread at most: a read starts only while the last second's reads took under 100 ms, and a slower one is paid back before the next. When your app is busy, the SDK skips captures and slows down instead of queueing work behind your code.
  • It never takes your app down. Every SDK call, hook and timer contains its own failures. Your app's own errors and crashes still reach your handlers, unchanged.
  • Without replay, close to nothing. Errors, logs, traces and metrics added no main-thread time we could measure on any platform, and no CPU in the browser, on Android or in Flutter. On iOS the SDK holds about 25 MB of memory and added about 2 s of CPU over a 75-second scroll.

What it costs

BrowserAndroidiOSFlutter
Replay off: errors, logs, traces, metricsNo measurable CPU; +7–12 MB memoryNothing measurableNo measurable main-thread time; +2 s CPU over a 75-second scroll; +24–26 MB memoryNothing measurable
Start time, replay offAbout +100 ms to first paint (77 KB to download)No changeNo measurable change (with replay on: about +0.5 s to the first frame of a cold start)No change
Replay on: main thread per captureNo capture loopAbout 1–2 msAbout 8 ms (the SDK's own timer, on the Simulator)About 2 ms (desktop), 4 ms (Android emulator)
Replay on: main thread per second of use3–9 ms2–7 ms3–11 ms, within the noise5–14 ms
Replay on: CPU, all threads+15 % over a 5-minute session+7 % over a 5-minute session+6 % on a live chart; +44 % while scrolling a picture grid+1 % on the desktop; not separable on the emulator
Replay on: memory+15–36 MB+6–13 MB+27–32 MB+6–14 MB
Replay on: upload, every session streamed with pictures130–255 KB a minute120–280 KB a minuteAbout 175 KB a minute; 1.5 MB a minute while scrolling a picture grid80–475 KB a minute

Measured on a small shop app over scripted sessions (browsing, a product page, search, a live chart, a long feed, checkout), five repeats per setting, each against the same app built without the SDK. The machines are GitHub Actions runners: headless Chromium, Android emulators, an iPhone Simulator and a Linux desktop, all slower than a real phone, so a real device spends less time per capture. The replay figures are for the heaviest setting, every session streamed with pictures. With the default buffer mode, replay stays in memory and uploads only a 30-second clip when an error happens.

Lowering the cost

  • Capture rate: in an app, fps sets the most captures a second, from 1 to 5 (5 by default). A screen that redraws all the time, such as a live chart, needs fewer.
  • Pictures: replay.images set to off, or kept at its wifi default, removes most of replay's upload, and on iOS most of its CPU while picture grids scroll.
  • Fewer sessions: keep the default buffer mode, or stream only a share of sessions with a Data Collection rule (replay.mode: "stream", replay.sessionSampleRate: 0.1).
  • Hide what you don't need: a masked or blanked region costs nothing extra and records less.

Every option is on each platform's Configure Session Capture page: JavaScript, Android, iOS and Flutter.

Related pages