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

Massively improves performance when not using labels #115

Conversation

kajgiesbersflavour
Copy link
Contributor

image

We have a map with over 11k regions which loads very slow. In the profiler I found out that the bbox call was the issue. It calls the bbox when creating the region and uses it to place the label in the right position, but we are not using labels at all. This small change improves the loading speed of our maps over 90%.
The reason the getbbox calculation is so slow is because it has to recalculate the style and in many cases causes a reflow of the page. There might be a way to get the bbox without doing the reflow, that would be a good performance improvement for people using labels.

@themustafaomar themustafaomar merged commit 3790611 into themustafaomar:main Feb 22, 2023
@themustafaomar
Copy link
Owner

Thanks for the great explanation and support! 🎉

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.

2 participants