Raanan
2018-10-17 11:12:05 UTC
Hi,
I use a Worker to do OffscreenCanvas rendering, and return a transferable
ImageBitmap to the main thread. Chrome 69.0.3497.100 (64 bit).
I see that the total time on main (from posting to the worker till
receiving the bitmap) is much larger than the combined times of postMessage
(serialization) and the worker processing time (till the return postMesage).
For example: numbers I see are (in ms):
mainTotal:73.4 mainPost:0.5 workerTotal:0.6
mainTotal:300.3 mainPost:0.9 workerTotal:1.2
I suspect the returned message from the worker spends this extra time in
the event loop queue on main thread until the onMessage is fired, since
meanwhile I process mouse events on the main thread. The other source
could be that the postMessage from the worker is slow, but since it is
basically just a transferable I think its not the issue.
My questions:
1. Could it be that the mouse event messages have a higher priority than
the worker return messages, and so are processed before the worker return
message even if they came after?
2. If so, is there a way to control the priority of the worker return
message? I prefer to draw as soon as the imageBitmap is ready
Thanks,
Raanan
I use a Worker to do OffscreenCanvas rendering, and return a transferable
ImageBitmap to the main thread. Chrome 69.0.3497.100 (64 bit).
I see that the total time on main (from posting to the worker till
receiving the bitmap) is much larger than the combined times of postMessage
(serialization) and the worker processing time (till the return postMesage).
For example: numbers I see are (in ms):
mainTotal:73.4 mainPost:0.5 workerTotal:0.6
mainTotal:300.3 mainPost:0.9 workerTotal:1.2
I suspect the returned message from the worker spends this extra time in
the event loop queue on main thread until the onMessage is fired, since
meanwhile I process mouse events on the main thread. The other source
could be that the postMessage from the worker is slow, but since it is
basically just a transferable I think its not the issue.
My questions:
1. Could it be that the mouse event messages have a higher priority than
the worker return messages, and so are processed before the worker return
message even if they came after?
2. If so, is there a way to control the priority of the worker return
message? I prefer to draw as soon as the imageBitmap is ready
Thanks,
Raanan
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/220ff38c-a5ff-47b1-8786-683d3c5e5f5c%40chromium.org.
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/220ff38c-a5ff-47b1-8786-683d3c5e5f5c%40chromium.org.