From 67af0979e38493db9e36530e60c4ed10aa78074d Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Thu, 7 Nov 2024 09:08:31 -0800 Subject: [PATCH] [skwasm] Make sure to include the transfer list when using postMessage. This change doesn't have unit tests, because it doesn't actually change the functional behavior of the renderer, it only changes its performance characteristics. If the transfer list is not included, the browser copies the image bitmaps instead of transfers them, which is slow, but does actually work. I am going to be adding some additional benchmarking in the framework to ensure that we detect if we regress something like this again. --- lib/web_ui/skwasm/library_skwasm_multi_threaded.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web_ui/skwasm/library_skwasm_multi_threaded.js b/lib/web_ui/skwasm/library_skwasm_multi_threaded.js index 0070adaf84be0..237ccf38bed10 100644 --- a/lib/web_ui/skwasm/library_skwasm_multi_threaded.js +++ b/lib/web_ui/skwasm/library_skwasm_multi_threaded.js @@ -43,7 +43,7 @@ mergeInto(LibraryManager.library, { if (threadId) { PThread.pthreads[threadId].postMessage(message, transfers); } else { - postMessage(message); + postMessage(message, transfers); } }; },