Open Bug 2015955 Opened 2 days ago Updated 1 day ago

Large event jank from synchronous decoding of images in Kotlin-wasm application

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect

Tracking

()

People

(Reporter: rhunt, Unassigned)

References

(Depends on 1 open bug)

Details

Reported to me through Mastodon [1].
STR:

  1. Go to: https://terrakok.github.io/firefox-slow-wasm/
  2. Scroll down fast on a start

ER:
In Firefox it freezes and drop frames.
In Chrome, Brave, and Safari it works smoothly.

I tested it out on my MacBook, and I think I can reproduce it. It looks like there is some jank while the images are lazily loaded by the application. Here is a profile [2]. There are multiple 200-300ms event jank on the main thread while 'ImageDecoderHelper::Run' is running. This is maybe triggered by 'mozilla::dom::CreateImageBitmapFromBlob'. I didn't see anything similar in Chrome when looking at a trace there [3].

The application is Kotlin compiled to wasm, and using WebGL+Canvas for rendering. The issue might better belong in the image component, so feel free to move it if that's the case.

[1] https://androiddev.social/@terrakok/116042463654897997
[2] https://share.firefox.dev/4r8swzH
[3] https://share.firefox.dev/3OyDkZy

I think this might be another instance of the same problem bug 1778394 is trying to fix.

Depends on: 1778394
You need to log in before you can comment on or make changes to this bug.