Another good followup would be to use TypedArray instead of ctypes array,
in order to use transferable objects feature of postMessage so that we avoid allocating data twice (or more).

Following bug (https://bugzilla.mozilla.org/show_bug.cgi?id=732936) introduced support of TypedArray for ctypes.
More infor about transferable objects here: https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers#Passing_data_by_transferring_ownership_%28transferable_objects%29