Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ajklein opened this issue Jun 12, 2013 · 1 comment
Closed

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

ajklein opened this issue Jun 12, 2013 · 1 comment

Comments

@ajklein
Copy link
Contributor

ajklein commented Jun 12, 2013

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).

@sorvell
Copy link
Contributor

sorvell commented Sep 25, 2013

This has been optimized away.

@sorvell sorvell closed this as completed Sep 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants