Skip to content

Calling offsetWidth in a style-modifying forEach is slow #180

Description

@ajklein

g-flow-panel-transition.html queries offsetWidth in a forEach loop, then modifies style. This will cause relayouts each time through the function:

https://github.com/Polymer/toolkit-ui/blob/master/elements/panel-transitions/g-flow-panel-transition.html#L119

(also in applyRightLayout, a little further down). I'm not clear on how many panels getPanels() is likely to return, but if it's more than 1 or 2 this is likely to be noticeable (I see it in a v8 profile, but again this should be taken with a grain of salt).

Activity

  1. sorvell commented on Sep 25, 2013

    @sorvell
    Contributor

    This has been optimized away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions