Skip to content

Significant performance loss of Picture.toImage on Web/Canvaskit compared to mobile/desktop #117786

@jonahwilliams

Description

@jonahwilliams

The fix for #103803 , flutter/engine#35276 improves performance compared to software rendering, but compared to mobile or desktop it leaves a lot on the table. Reading back the pixels through the CPU is a high latency operation that can stall rendering for multiple milliseconds even on very fast computers. For example, on my gaming desktop PC, this takes anywhere from 5-10ms.

arogueexperiment - Google Chrome 12_29_2022 11_16_09 AM

This is a particularly troublesome regression, because most of the interesting usage of shaders involve re-sampling some part of the child widgets using toImage. On mobile/desktop this operation is nearly free as we're simply manipulating a texture that already exists (or will exist) on the GPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)e: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions