You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ✅ Eliminates the O(n) copy for large buffers; measurable improvement at ~1 MB+.
534
534
* ✅ Pre-building `TransferableTypedData` before calling `compute()` removes the codec overhead and is the fastest option.
535
-
* ⚠ Small buffers (< ~100 KB) may see no net gain or a slight regression due to codec overhead.
536
-
* ⚠ The source buffer is consumed by `TransferableTypedData`; do not reuse the original `Uint8List` after calling `compute()` with it as a transferable.
535
+
* ⚠️ Small buffers (< ~100 KB) may see no net gain or a slight regression due to codec overhead.
536
+
* ⚠️ The source buffer is consumed by `TransferableTypedData`; do not reuse the original `Uint8List` after calling `compute()` with it as a transferable.
537
537
538
538
**Web — dart2js:**
539
539
540
540
* ✅ Source `ArrayBuffer` is transferred in O(1); the worker receives the original memory.
541
541
* ✅ Large speedups (2–10×) for MB-range payloads compared to copy-based transfer.
542
-
* ⚠ Source buffer is **neutered** after `compute()` returns — `data.buffer.lengthInBytes` becomes 0. Keep a reference to the result instead.
542
+
* ⚠️ Source buffer is **neutered** after `compute()` returns — `data.buffer.lengthInBytes` becomes 0. Keep a reference to the result instead.
543
543
544
544
**Web — dart2wasm:**
545
545
546
-
* ⚠ WASM uses linear memory that is opaque to the JS engine. Every transfer still requires a copy from the WASM heap to a JS `ArrayBuffer`, so using `transferables` adds codec overhead with no speed benefit.
546
+
* ⚠️ WASM uses linear memory that is opaque to the JS engine. Every transfer still requires a copy from the WASM heap to a JS `ArrayBuffer`, so using `transferables` adds codec overhead with no speed benefit.
547
547
* Prefer omitting `transferables` when targeting WASM.
548
+
* ⚠️ **Note:**`enableWasmTransferables` is set to `true` by default for WASM targets to disable transferables on WASM targets to avoid codec overhead. If you want to disable it, set `enableWasmTransferables: false` in the `IsolateManager` constructor.
0 commit comments