Skip to content
Discussion options

You must be logged in to vote

Hope this helps. I changed the amount of data to 50MB. When I used 250KB there wasn't a noticeable difference.

WorkerTransferExample

Live Demo

  • The demo generates 50MB of random data and sends it to a web worker for processing.
  • The demo first sends the data without using WorkerTransfer, which results in the data being copied to the worker.
  • Then the demo sends the data using WorkerTransfer, which results in the data being transferred to the worker (the original data becomes detached and cannot be used anymore).
  • The demo measures and displays the time taken for each operation and verifies data integrity.

Example output from the demo:

Processed without WorkerTransfer 52428800 bytes in 27 ms…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Swizzy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@Swizzy
Comment options

@LostBeard
Comment options

@Swizzy
Comment options

@LostBeard
Comment options

@LostBeard
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
example Example is requested
2 participants