w3cli icon indicating copy to clipboard operation
w3cli copied to clipboard

feat: use worker thread for piece hashing

Open alanshaw opened this issue 1 year ago • 0 comments

Worker threads actually share memory in Node.js so there's no copy getting the CAR bytes into the worker. This allows WASM piece hashing in a worker that doesn't stall the main thread.

Before

Notice how the spinner is stalled for multiple seconds as piece hashing is done:

https://github.com/storacha-network/w3cli/assets/152863/5d88f8c5-e7ae-4da3-96ce-a686fb3f2258

After

No stall!

https://github.com/storacha-network/w3cli/assets/152863/747a412e-1c27-456b-913f-a4ec6e29498a

alanshaw avatar Jun 24 '24 19:06 alanshaw