David Herman
01/19/2024, 6:24 AMconst uInt8Array = new Uint8Array(1024 * 1024 * 8).map((v, i) => i);
console.log(uInt8Array.byteLength); // 8388608
worker.postMessage(uInt8Array, [uInt8Array.buffer]);
console.log(uInt8Array.byteLength); // 0
Robert Jaros
01/19/2024, 6:27 AMDavid Herman
01/19/2024, 6:41 AMDavid Herman
01/19/2024, 6:42 AMDavid Herman
01/19/2024, 6:45 AMRobert Jaros
01/19/2024, 6:45 AMDavid Herman
01/19/2024, 6:45 AMDavid Herman
01/19/2024, 6:46 AMDavid Herman
01/19/2024, 6:46 AMturansky
01/19/2024, 11:04 AMalthough it's still weird it's posting both the array itself and the buffer as an array?It's an option, you can "transfer" buffer, or don't transfer