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

Main thread does not coalesce queued onPlacement messages #8435

Closed

Description

@ChrisLoer

When a user rotates the map, the main thread will queue many placement requests to the worker threads (one for each incremental bit of rotation). If the worker threads start producing responses to the placement requests faster than the main thread can draw them (perhaps the main thread is doing something else that's expensive besides just drawing the map), a backlog of placement results will build up.

Specifically:

  • Each GeometryTile contains a Mailbox that will have a queue of onPlacement messages.
  • The main thread RunLoop will pop the first message out of each 'Mailbox' and process it, triggering GeometryTile::onPlacement calls for each tile, which will trigger a paint call through Map::Impl->onUpdate. These will all get coalesced into one queued paint request. The RunLoop will also queue a request to process the next item in each non-empty Mailbox
  • The process repeats with one paint call for each onPlacement message in a Mailbox, even though only the latest message has up-to-date results.

The time-lagged placement calls can lead to label flicker:

lagging collisions

/cc @jfirebaugh @mourner

Activity

  1. added
    performance
    on Mar 16, 2017
  2. self-assigned this
    on May 15, 2017
  3. ChrisLoer commented on May 17, 2017

    @ChrisLoer
    ContributorAuthor

    Fixed with #9031.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions