Skip to content

Investigate performance issues with recording replay canvas #10497

Closed as not planned

Description

@billyvg

Example profile of this occurring.

We should look into moving the createImageBitmap call into a webworker.

Another task that blocks the UI is on the initial serialization snapshot. rrweb calls toDataURL() on the canvas in the main UI thread to export as an image.

Activity

  1. bruno-garcia commented on Feb 26, 2024

    @bruno-garcia
    Member

    We'll potentially move the createImageBitmap call to the web worker. Further investigation needed

  2. billyvg commented on Mar 12, 2024

    @billyvg
    MemberAuthor
    • We can't move createImageBitmap to web worker because:
      • we would need to transfer canvas to webworker which can only be done if we convert it to offscreen canvas
        • by transferring control to offscreen canvas, we cannot write to the canvas from the UI
      • it might be possible to clone the canvas and transfer it to web worker -- initial benchmarks seem to indicate that copying the canvas is faster than createImageBitmap, though probably increased memory usage

    Though, from looking at recent profiles, I don't see createImageBitmap as that big of an issue -- I see more main thread blocking from toDataURL when serializing the initial DOM snapshot. Have not gotten around to investigating that yet.

  3. mydea commented on Dec 11, 2024

    @mydea
    Member

    @billyvg I am closing this for now as I do not think we have any work planned on this - we can always reopen if relevant!

  4. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions