Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Fix placement for updated buckets #15308

Merged
merged 5 commits into from
Sep 13, 2019

Conversation

pozdnyakov
Copy link
Contributor

Before this change, just loaded buckets could not be placed until the new placement was created in a 300 ms period, and it caused a latency in symbols appearance.
Now buckets load initiates new placement, so that newly added symbols get placed immediately.
Before:
before

After:
after

(Transition duration is set to 1 s for better visibility)

Another positive impact is that a Placement instance does not have to set opacity for the symbols, which it did not place. So, updateBucketOpacities() call now does not mutate the placement, tagging #14638

@pozdnyakov pozdnyakov added Core The cross-platform C++ core, aka mbgl rendering text rendering labels Aug 4, 2019
@pozdnyakov pozdnyakov self-assigned this Aug 4, 2019
@pozdnyakov
Copy link
Contributor Author

cc @tobrun

@alexshalamov
Copy link
Contributor

@pozdnyakov There is a visible flickering in the second gif file.

@ansis
Copy link
Contributor

ansis commented Aug 19, 2019

The flickering looks like it might be caused by the parent tile loading before the other tiles. Maybe the previous placement delay covered that up.

This downside of this change is that placement will run more frequently and placement can be expensive. If a map is already dropping frames this might make it drop even more frames. If it's fast enough this should be a great change.

In -js we currently have to split placement across multiple frames and make it less frequent to avoid jankiness. I'm currently trying to tweak this to make placement more frequent during zooming to get rid of the label bunching effect that happens when you zoom out fast. mapbox/mapbox-gl-js#8628

But if this is fast enough in -native then doing it more frequently should be great!

@pozdnyakov pozdnyakov force-pushed the mikhail_updated_buckets_placement branch from b5550f1 to 8344118 Compare September 10, 2019 10:47
@pozdnyakov
Copy link
Contributor Author

@ansis @alexshalamov Thanks for your comments!

The flickering looks like it might be caused by the parent tile loading before the other tiles. Maybe the previous placement delay covered that up.

True, the fading label is from the parent tile, same behavior however can be observed with the current implementation as well.

This downside of this change is that placement will run more frequently and placement can be expensive.

To mitigate this, the latest commit invokes the new placement only when new buckets are registered.
Further, this code path will be moved into a separate thread #14638

@pozdnyakov pozdnyakov added needs changelog Indicates PR needs a changelog entry prior to merging. performance Speed, stability, CPU usage, memory usage, or power usage labels Sep 10, 2019
Copy link
Contributor

@alexshalamov alexshalamov left a comment

Choose a reason for hiding this comment

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

lgtm

src/mbgl/renderer/render_orchestrator.cpp Outdated Show resolved Hide resolved
@pozdnyakov pozdnyakov force-pushed the mikhail_updated_buckets_placement branch from b7a038f to 6c57b96 Compare September 10, 2019 14:38
@astojilj
Copy link
Contributor

This downside of this change is that placement will run more frequently and placement can be expensive.

To mitigate this, the latest commit invokes the new placement only when new buckets are registered.

How to measure impact of this patch on zooming and panning? We could get rough estimate using iOS demo app FPS counter, on low end phone.

@pozdnyakov pozdnyakov force-pushed the mikhail_updated_buckets_placement branch from 6c57b96 to 4ee7d99 Compare September 13, 2019 08:31
Copy link
Contributor

@alexshalamov alexshalamov left a comment

Choose a reason for hiding this comment

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

lgtm

@pozdnyakov
Copy link
Contributor Author

How to measure impact of this patch on zooming and panning? We could get rough estimate using iOS demo app FPS counter, on low end phone.

Metrics collected with this branch did not discover any negative performance impact caused by the patch.

@pozdnyakov pozdnyakov requested a review from a team September 13, 2019 10:15
@pozdnyakov pozdnyakov removed the needs changelog Indicates PR needs a changelog entry prior to merging. label Sep 13, 2019
@pozdnyakov pozdnyakov merged commit 048e2c8 into master Sep 13, 2019
@pozdnyakov pozdnyakov deleted the mikhail_updated_buckets_placement branch September 13, 2019 10:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl performance Speed, stability, CPU usage, memory usage, or power usage rendering text rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants