getsentry / rrweb

record and replay the web
https://www.rrweb.io/
Other
9 stars 5 forks source link

fix: manual snapshot in rAF loop #210

Closed ShinyChang closed 3 weeks ago

ShinyChang commented 1 month ago

Background

I followed Set Up Session Replay | Sentry for Javascript and got CPU high usage.

CleanShot-2024-07-10-at-15 22 35@2x

Solution

The takeCanvasSnapshots should not be in rAF loop when the isManualSnapshot is true. I also checked the rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.ts at master · rrweb-io/rrweb and confirmed it's Sentry customized logic.