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

Globe view downloading more tiles than necessary #11958

Open
SnailBones opened this issue Jun 3, 2022 · 1 comment
Open

Globe view downloading more tiles than necessary #11958

SnailBones opened this issue Jun 3, 2022 · 1 comment
Labels
3d 📐 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@SnailBones
Copy link
Contributor

SnailBones commented Jun 3, 2022

As pointed out by @ansis in #11917 (comment)

Steps to Trigger Behavior

  1. Go to http://localhost:9966/debug/projections.html#3.11/2.01/0.71
  2. Switch projection to globe and enable debug tiles
  3. Shrink window so that only four tiles are visible
    image
  4. In console:
Object.keys(map.style._sourceCaches['other:composite']._tiles).length
8

Logging the tiles, we can see that tiles columns 2 and 5 are included, which are to the right and left of the visible screen:

[
    [3, 4, 3],
    [3, 4, 4],
    [3, 3, 3],
    [3, 3, 4],
    [3, 5, 3],
    [3, 5, 4],
    [3, 2, 3],
    [3, 2, 4]
];

This issue also occurs with raster tiles and can be tested with:

Object.keys(map.style._sourceCaches['other:mapbox']._tiles).length

Removing these extra tiles should be a low-hanging fruit for improving performance, though it may require a more involved collision detection algorithm than the axis-aligned-bounding-box approach introduced in #11508.

On the other hand, it's possible that including these extra tiles in the cache could improve performance on subsequent panning. (Though even if this was included as a feature, they should not cause additional draw calls).

cc @ansis @akoylasar

@SnailBones
Copy link
Contributor Author

cc @mpulkki-mapbox @mapbox/gl-native

@SnailBones SnailBones added bug 🐞 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage 3d 📐 and removed bug 🐞 labels Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3d 📐 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
1 participant