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

#1704 Optimize Annotations' position update #1761

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

Conversation

MichalDybizbanskiCreoox
Copy link
Collaborator

@MichalDybizbanskiCreoox MichalDybizbanskiCreoox commented Dec 9, 2024

I have mixed feelings about this change.
We might want to look for a performance improvement that doesn't require setting an extra flag and potentially (though unlikely) sacrificing some positioning precision.
That might involve a different method of rendering a marker though.
Hopefully a huge number of Annotations, which makes this performance improvement necessary, is not a very common case.

Previous approach, required an explicit user call to take advantage of the optimization.
I've changed the approach to instead automatically rely on cached widths values (which are expensive to obtain), and postpone the expensive calculations by some timeout.
This way the calculations don't interfere with e.g. interactive camera manipulation, and are delayed to after the camera manipulation stops.
Even though cached values might not represent actual widths while the calculation is delayed, that shouldn't be a practical problem.

@MichalDybizbanskiCreoox MichalDybizbanskiCreoox force-pushed the 1704-improve-annotations-performance branch from a12e509 to 8e0b67b Compare February 6, 2025 14:56
@MichalDybizbanskiCreoox MichalDybizbanskiCreoox force-pushed the 1704-improve-annotations-performance branch from 8e0b67b to 95bedb4 Compare February 6, 2025 16:44
@MichalDybizbanskiCreoox MichalDybizbanskiCreoox changed the title #1704 Expose Annotation::setPreventWidthUpdate to allow skipping expensive getBoundingClientRect (for performance) #1704 Optimize Annotations' position update Feb 6, 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.

1 participant