[w3c/FileAPI] Add readAsSharedArrayBuffer to FileReader (#73)

To allow workers play with file contents currently you have three options (maybe more): 
- Post a message to the worker with the File (structured cloning is costly).
- Read the file as an array buffer and transfer it to the worker context (it's no longer accesible from other contexts).
- Read the file as an array buffer and copy it's contents to a shared array buffer (still a copy is needed).

If you need to parallelize tasks over file contents (e.g. parsing a big csv file) there is no way to do it without perform a copy which is costly operation when you deal with large files.

**It would be great to have a readAsSharedArrayBuffer to read the file straight in a shared array buffer and thus avoid the copy.** It would be cool to allow file reading in parallel but that's another issue.

Is there any other way to perform this with the current specs that I'm missing?


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/73

Received on Friday, 3 March 2017 18:12:44 UTC