Skip to content

Massively improves performance when not using labels#115

Merged
themustafaomar merged 1 commit intothemustafaomar:mainfrom
kajgiesbersflavour:performance_improvement_when_nolabels
Feb 22, 2023
Merged

Massively improves performance when not using labels#115
themustafaomar merged 1 commit intothemustafaomar:mainfrom
kajgiesbersflavour:performance_improvement_when_nolabels

Conversation

@kajgiesbersflavour
Copy link
Copy Markdown
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
Copy Markdown
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