WebReflection / coincident

An Atomics based Proxy to simplify, and synchronize, Worker related tasks.
MIT License
201 stars 3 forks source link

WIP: trying to understand benefits of "direct buffers" #33

Closed WebReflection closed 1 year ago

WebReflection commented 1 year ago

This MR tries to address #31 but:

I might just also quick check both times and see if it's substantially faster to do this way, but I think I am going to close this and flag the related issue as won't fix.

WebReflection commented 1 year ago

this is with the current PR:

serialize: 2.750927734375 ms
es.js:2 deserialize: 1.40693359375 ms

this is with the current module as is, without this PR:

serialize: 4.90185546875 ms
es.js:2 deserialize: 3.505126953125 ms

in short, passing huge buffers is roughly twice as fast in here, but as we're speaking ms I am not sure I want to move forward with this idea, but it's OK to have already experimented with it in case I'll change my mind in the future.