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

Fix (Performance): Improve performance for getting custom breakpoints #3479

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mxkae
Copy link
Contributor

@mxkae mxkae commented Apr 2, 2025

fixes #3477

Copy link

github-actions bot commented Apr 2, 2025

🤖 Pull request artifacts

file commit
pr3479-stackable-3479-merge.zip 438b8c9

github-actions bot added a commit that referenced this pull request Apr 2, 2025
Copy link
Contributor

@bfintal bfintal left a comment

Choose a reason for hiding this comment

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

I feel that this implementation has a chance to break themes and other integrations that already successfully change the breakpoints, mainly because you are changing when the values are computed/loaded. Currently, the breakpoints are calculated when the css is about to be parsed, the new implementation does it early in the lifecycle, so existing hooks might not run correctly

Instead, I would recommend caching the values from within get_dynamic_breakpoints().

Use code profiler to check this, maybe this line is also slow:

return ! empty( $breakpoints['tablet'] ) || ! empty( $breakpoints['mobile'] );

github-actions bot added a commit that referenced this pull request Apr 11, 2025
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.

Improve performance of has_custom_breakpoints()
2 participants