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

Perf: Optimise resizerObservers setup #1325

Merged
merged 4 commits into from
Aug 29, 2024

Conversation

davidjbradshaw
Copy link
Owner

The setup routine for the resizeObservers to the child page has to iterate over all page elements during load so this change has optimised this code for performance, over keeping esLint happy.

This change has removed extra function calls, by switching for forEach() to for...of and removing filter(). It has also reordered the checks on each node, so that the most efficient are performed first, in order to reduce the need for the more expensive checks.

packages/child/index.js Dismissed Show dismissed Hide dismissed
packages/child/index.js Dismissed Show dismissed Hide dismissed
@davidjbradshaw davidjbradshaw merged commit 5d4facb into master Aug 29, 2024
4 checks passed
@davidjbradshaw davidjbradshaw deleted the perf_resize_observers_setup branch August 29, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant