Skip to content

Investigate getComputedStyle performance #9

@devrelm

Description

@devrelm

It looks like getComputedStyle returns a "live" CSSStyleDeclaration that automatically updates its properties.

It'd be nice to check out how we could use this to our advantage for performance, or whether it might be unnecessary or even bad to do so.

To Do:

  • What do the specs say?
  • How do browsers behave?
  • Can we cache the CSSStyleDeclaration?
  • Is it even that expensive to call getComputedStyle? (For instance, does the browser already have all these CSSStyleDeclaration objects sitting there, making getComputedStyle basically just a property accessor?)
  • Does it become expensive to hold onto a bunch of "live" CSSStyleDeclaration objects? (For instance, if the object doesn't exist before calling getComputedStyle, and updates values whether or not we check them, does it end up being worse for performance?)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions