Skip to content

Replay recorder starts when the page is idle, not during load - #216

Merged
boehlerlukas merged 1 commit into
masterfrom
gleap/g2-widget-load-perf
Nov 13, 2026
Merged

boehlerlukas merged 1 commit into
masterfrom
gleap/g2-widget-load-perf

Conversation

@boehlerlukas

Copy link
Copy Markdown
Contributor

What

Automatic replay starts (init and config) wait for idle (≤2 s); without requestIdleCallback (Safari) they wait for page load. If replays are off and the config arrives first, rrweb never runs. New GleapIdle.js.

Why

G2 reviews (Elias K., Oct 2026; Sam S., Apr 2026): slow widget load on content-heavy sites. rrweb's full snapshot was ~80% of the SDK's main-thread time on a 7.8K-node page. Before the button appears: 149 → 4 ms blocking; replays off: 134 → 14 ms. With replays on the same work runs, just later.

Checks

npx jest 749/749 ✅. Build only used to benchmark (build/ and published/ restored).

Risk

A feedback report opened within ~2 s of page load can have a shorter replay. Not tested on real devices or slow networks.

🤖 Generated with Claude Code

Automatic replay starts (at init and from config) wait for an idle moment,
at most 2 s; without requestIdleCallback (Safari) they wait for page load.
If replays are off and the config arrives first, rrweb never runs.
New GleapIdle.js. On a 7.8K-node page with 4x CPU throttle, main-thread
blocking before the button appears: 149 → 4 ms; replays off: 134 → 14 ms.

From G2 reviews (Elias K., Oct 2026; Sam S., Apr 2026).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boehlerlukas
boehlerlukas merged commit 9b31399 into master Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant