Skip to content

Is fetchEvent.client a performance concern? #723

@jakearchibald

Description

@jakearchibald

From https://code.google.com/p/chromium/issues/detail?id=470036

@mattto:

It's fairly costly for our implementation to populate client.visibilityState and client.focused when dispatching the fetch event. We have to hop from the IO thread to the UI thread and back again. Doing that on every network fetch would surely make SW slower than non-SW.

I'd like to hear Mozilla's take on this @nikhilm @wanderview. If there are similar concerns, I'm happy to change this to a client ID, or perhaps rethink how we get this information from clients.

Other options include fetchEvent.getClient() which returns a promise, or move the state properties on client into something like client.getState() - although this makes iterating over clients to find a focused one kinda tough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions