WebUSB/transferIn: how to reuse memory?

69 Views Asked by At

transferIn seems allocate memory each function call, is there any way to reuse it?

My goal is to get lots of data from device, with a dedicated web worker and this advice, performance still not good enough. From performance tab in dev tools, found that the delayed is caused by GC.

1

There are 1 best solutions below

0
Reilly Grant On

Add a comment to https://github.com/WICG/webusb/issues/217 with your observations. The one thing I'm unsure of is whether just reducing buffer allocations will help since there are still other small allocations involved in calling those methods.