Skip to content

Experiments with communicating with Web Workers using just Transferables.

License

Notifications You must be signed in to change notification settings

timkendall/webworker-protobuffs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webworker-protobuffs

Experiments with communicating with Web Workers using just Transferables.

Data types are declared with Protocol Buffers using dcodeIO/protobuf.js and then converted to ArrayBuffer's before being transfered to thw Worker thread with postMessage.

Preliminary results are that using this method vs. the standard passing of object literals is ~2x slower.

Note: There is currently a bug where subsequent ProtoBuff messages fail due to Protobuff.js reusing the same ArrayBuffer internally (i.e the one we transfer to the Worker). This could likely be solved by cloning the buffer.

Running

  1. yarn
  2. yarn start
  3. Open http://localhost:1234 and view console

License

MIT

About

Experiments with communicating with Web Workers using just Transferables.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published