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

Optimize matrix calculation for labels #7967

Merged
merged 1 commit into from
Feb 28, 2019
Merged

Conversation

mourner
Copy link
Member

@mourner mourner commented Feb 28, 2019

I noticed that getLabelPlaneMatrix and getGlCoordMatrix functions were taking considerable time on the main thread, and made matrix caching more aggressive to avoid a lot of this work, at least for screen-aligned labels which dominate the map. After the changes they take 10x less time.

We could cache even more (and I might follow up on this), but this PR gets us most of the way there with minimal changes.

Before:
image

After:
image

Bench:
image

Curiously, paint benchmark is nearly unaffected.

  • briefly describe the changes in this PR
  • post benchmark scores
  • manually test the debug page

@mourner mourner requested a review from ansis February 28, 2019 14:30
@mourner mourner added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Feb 28, 2019
Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

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

Looks great!

@mourner mourner merged commit a88b541 into master Feb 28, 2019
@mourner mourner deleted the optimize-label-matrices branch February 28, 2019 17:59
@pakastin
Copy link
Contributor

pakastin commented Apr 2, 2019

Wow, this makes such a huge difference in Aviamaps!
https://aviamaps.com/map

Awesome work! 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants