Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages