Re: [slightlyoff/ServiceWorker] consider allowing multiple worker thread instances for a single registration (#756)

> I use Clients.claim a lot just to choke down the simplicity of the SW life cycle (which for me has always been the most complicated aspect of dealing with Service Workers). How would that work with a litany of SWs claiming the client in rapid succession?

We would still only allow one instance of the SW to run the install and activate events at a single time.  Updates would be single threaded.  I mention this because thats when most SW's call `clients.claim()`.

If you call `clients.claim()` on every FetchEvent, though, I think it would still work.  It would be about the same amount of work whether we have a single instance or multiple instances.  You have to look across all processes at all windows to potentially mark them as controlled.  That workload does not really change with more running service worker instances.

If you are doing heavy js or `clients.claim()` at the top level script evaluation, though, then you would likely see a performance hit from spinning up more thread instances.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/756#issuecomment-237859579

Received on Friday, 5 August 2016 14:07:40 UTC