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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 amp-actions hide() can skipRemeasure #27654

Merged
merged 6 commits into from Apr 13, 2020

Conversation

samouri
Copy link
Member

@samouri samouri commented Apr 8, 2020

summary
Recently, I've added support to mutator-impl.mutateElement to skip the remeasurement of an element in cases we know that it is unnecessary. I believe I've found another (albeit less significant) case.

The hide() action calls mutateElement, but I believe it then performs its own measurements within collapseElement (e.g. sets it all to 0, since display:none). It then sets relayoutTop and schedules a new pass.

@ampproject ampproject deleted a comment Apr 8, 2020
@ampproject ampproject deleted a comment Apr 8, 2020
@ampproject ampproject deleted a comment Apr 8, 2020
@samouri samouri requested review from jridgewell and dreamofabear and removed request for kevinkimball April 8, 2020 22:15
@samouri samouri changed the title optimization: hide() can skipRemeasure 馃殌 amp-actions hide() can skipRemeasure Apr 8, 2020
@samouri samouri marked this pull request as ready for review April 8, 2020 22:15
@samouri samouri added this to In progress in Performance Improvements via automation Apr 8, 2020
@kristoferbaxter
Copy link
Contributor

Thanks for marking this work with the "Performance Improvements" project. Much appreciated.

Copy link
Contributor

@kristoferbaxter kristoferbaxter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change, seems prudent to me and the comment is appreciated.

@samouri samouri merged commit 623383d into ampproject:master Apr 13, 2020
Performance Improvements automation moved this from In progress to Done Apr 13, 2020
@samouri samouri deleted the opt-actions branch April 13, 2020 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants