I'm running two libraries that are dependency aware. What I mean is the order of their execution does not matter. They will detect each other and run in any order.
script1.js
script2.js
Would I benefit by running these scripts in parallel (parallel processing) using web workers? (MDN Doc)
I mean would they run faster than if I just ran them serially?
Both scripts are already available on the client ( I don't have to download them ).
If one or both of the scripts is/are purely functional, meaning it doesn't need to access the DOM or any global Javascript objects, then you could benefit from using Web Workers.
If this is not the case, then Web Workers will do you no good. When JS is run through a web worker, it can only pass messages back to the main DOM thread and receive them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With