Context:
During the GridScrollBenchmark investigation, we observed that while the Grid (Main Thread) scrolls at >1000 FPS in the test environment, the OffscreenCanvas animations (Header, Sparklines) running in a Worker appear "frozen" or extremely choppy (~4 FPS) on larger viewports (Laptop/Desktop) in Headless Chrome.
Observations:
- Mobile (375x667) animations are mostly smooth.
- Desktop (1920x1080) animations are frozen.
- Local Chrome (Headed) on the same machine runs everything at 60 FPS+.
- Forcing
deviceScaleFactor: 1 did NOT solve it.
- Disabling background throttling did NOT solve it.
Objective:
Investigate why Playwright/Headless Chrome struggles to composite Worker-driven OffscreenCanvas updates on high-resolution viewports. Is it a message passing bottleneck, a compositor scheduling issue, or a specific Headless Chrome limitation?
Tasks:
- Create a dedicated
CanvasAnimationBenchmark.spec.mjs.
- Profile the
CanvasWorker thread during the test.
- Experiment with
transferControlToOffscreen vs ImageBitmap commit strategies.
Context: During the
GridScrollBenchmarkinvestigation, we observed that while the Grid (Main Thread) scrolls at >1000 FPS in the test environment, theOffscreenCanvasanimations (Header, Sparklines) running in a Worker appear "frozen" or extremely choppy (~4 FPS) on larger viewports (Laptop/Desktop) in Headless Chrome.Observations:
deviceScaleFactor: 1did NOT solve it.Objective: Investigate why Playwright/Headless Chrome struggles to composite Worker-driven
OffscreenCanvasupdates on high-resolution viewports. Is it a message passing bottleneck, a compositor scheduling issue, or a specific Headless Chrome limitation?Tasks:
CanvasAnimationBenchmark.spec.mjs.CanvasWorkerthread during the test.transferControlToOffscreenvsImageBitmapcommit strategies.