Since I've tried out webworkers for the first time I'm struggling to find a real use case for them. Communication with them isn't as easy as just passing objects or references, they don't have a window object so I can't use JQuery and the increased complexity of building an interface is not worth the load saved on the main thread. So all the options I'm left with are basically working through large arrays to gain a performance advantage.
Today I thought about opening a new window by window.open() and use the newly created window object to do some task and pass the result back to the main window. I should even be able to access the DOM of the main window by accessing the window.openervariable in the new window.
My questions are:
- Is that really going to give me a performance advantage?
- Are there any caveats about this idea besides more complicated debugging?
- Can I access the DOM of the main window from the new window using the
window.openervariable and take the load of creating new DOM elements from the main thread?
Aucun commentaire:
Enregistrer un commentaire