publiclab / image-sequencer

A pure JavaScript sequential image processing system, inspired by storyboards
https://sequencer.publiclab.org
GNU General Public License v3.0
110 stars 208 forks source link

Implementing web workers for multithreading pixelManipulation.js #1069

Open Divy123 opened 5 years ago

Divy123 commented 5 years ago

Please describe the problem (or idea)

Implementing web workers with threads.js

Please show us where to look

https://beta.sequencer.publiclab.org

What's your PublicLab.org username?

lit2017001

Thank you!

Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

Divy123 commented 5 years ago

@jywarren currently I am working on implementing multithreading but with web-workers, we can not clone any DOM components, which are heavily built in our image-sequencer object.

What do you suggest upon this?

Divy123 commented 5 years ago

@jywarren @tech4GT @HarshKhandeparkar @Mridul97 I have been trying transferring segments of Run.js into workers. But I think this needs something more than that:

@Mridul97 So thing with this one is that this makes more sense for the browser since it becomes unresponsive while waiting for complex steps like edge-detect to run, what we want is a system where sequencer.run() is called on a different thread.

As @tech4GT said here. Can someone please explain the exact meaning, and for sure this is a priority for browser but does browserify has a support for this?

Please help me as this is a bit urgent.

jywarren commented 5 years ago

DOM components, which are heavily built in our image-sequencer object

But isn't the core of image-sequencer using no DOM, which is how it runs in node? I wonder if we can get some input from @rishabh570 or @rexagod on what portions of this could be most easily put into web workers?

Could we put just the pixelManipulation portion of each step into an asynchronous webworker, or is it too much work to copy over the data anyways?

Divy123 commented 5 years ago

Sure I will look into what it takes for the data transfer!!