I am writing a Chrome extension that stores a large amount of data in the localStorage browser and analyzes it on every page load. Now, as data size increases, page load / page performance starts to deteriorate. So I decided to pass the parsing to the web worker. But I doubt it is worthy. What I can do is pass my line, which will be parsed for such an employee.
worker.postMessage(localStorage['myObj']);
And I plan to parse this string in JSON and send it back to the main stream, for example
worker.onMessage(function(myObj){
});
But since I searched in terms of the performance of this method, including messages and posting messages, as well as the fact that some browsers do not allow JSON objects to be sent to a message and some serialize it automatically when sending, I doubt that this method deserves attention.
Since my application is just a Chrome extension as well as Firefox Addon, I am only interested in these two browsers. Can someone suggest me if this method is suitable for these two browsers?
source
share