I'm trying to do some processing with webworker on image data from canvas. Solution, that I have right know, works quite ok, but there are still some visible lags when I do the processing (because besides processing I have to draw video from webcam to canvas and it starts to lag).
So I tried to use webworker and I did everything asynchronously. The only problem is that when I use JSON.stringify, it takes longer than actual processing.
My question: is there any other way, how to pass lot of data via worker.postMessage quickly? Is there some kind of workaround that I don't know about?
Small subquestion: what for are webworkers? I find workers really useless, passing just strings.
EDIT:
possible duplicate: Pass large amounts of data between web worker and main thread