Investigate using a web worker?
I am curious about your plans. Are you planning to integrate webworker support natively? I was able to wrap UMAP-js in a webworker and it seems to work fine.
Yeah, it's pretty straightforward to wrap up in a web worker if you need to, but it'd be extra awesome if the lib could bootstrap itself into a web worker if it was so configured... I think this is actually a really wild, tricky thing to do (and probably isn't worth the effort), but it sure would be neat!
I've packaged Workers into libraries before, and this would be useful to me as well, so I'm going to give it a shot. LMK if for some reason you're not open to a PR on this! I'll aim for backwards-compatibility with the current imports of course. That is, current imports will still be non-Worker, but there will be another set of imports that will put the compute in a Worker.
Hi all @flekschas @cannoneyed @jebeck, can you share your script?
@igaloly For one approach see:
- https://github.com/flekschas/piling.js/blob/master/src/umap.js
- https://github.com/flekschas/piling.js/blob/master/src/umap-worker.js