Currently, I am working on a code that manages all AJAX requests using Web Workers (where available). These workers are mainly handling the XMLHttpRequest
object without any additional computations. All requests initiated by the workers are asynchronous (request.open("get",url,true)
).
Lately, I have encountered some issues with this code and it has made me question whether I should invest time in fixing it or simply discard the entire solution.
My research indicates that this code might actually be affecting performance negatively. However, I have not been able to find any credible sources to support this claim. The only leads I could uncover are:
- A two-year-old jQuery feature suggestion to utilize web workers for AJAX calls
- This Stack Overflow question that appears to discuss a slightly different topic (using synchronous requests in web workers versus AJAX calls)
Could someone direct me towards a dependable source that discusses this dilemma? Alternatively, are there any benchmarks available that can alleviate my concerns?
[EDIT] The complexity of this question deepens when the Web Worker is also responsible for parsing the result using JSON.parse
. Does asynchronous parsing yield better performance results?