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

Degraded FPS when upgrading from 7.4.0-alpha.1 -> 7.4.0-alpha.2 #14902

Closed
jdale38 opened this issue Jun 11, 2019 · 8 comments
Closed

Degraded FPS when upgrading from 7.4.0-alpha.1 -> 7.4.0-alpha.2 #14902

jdale38 opened this issue Jun 11, 2019 · 8 comments
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl

Comments

@jdale38
Copy link

jdale38 commented Jun 11, 2019

When updating to the latest stable Android SDK v8.0.0 from v6.8.2, I've noticed some degradation in FPS rendering the map view. I've been able to pin point the change in behavior between v7.4.0-alpha.1 and v7.4.0-alpha.2. It may have something to do with this commit at line 254:

4b19324#diff-2385730c5fa63a2ee05519037d6676c3R254

The nested for loop would make an impact on a fairly large stylesheet with a lot of sources and layers. Let me know if there's any other information you need to debug. Thanks!

Steps to reproduce

  1. build app with v7.4.0-alpha.1
  2. load stylesheet with 10+ sources and 3000+ layers
  3. inspect fps values
  4. repeat for v7.4.0-alpha.2

Expected behavior

Same FPS or better when upgrading/updating SDK.

Actual behavior

Lowered FPS when rendering map.

Configuration

Android versions: 9
Device models: Pixel, Android emulator
Mapbox SDK versions: 7.4.0-alpha.2 or greater

@tobrun
Copy link
Member

tobrun commented Jun 12, 2019

cc @pozdnyakov @tmpsantos

@tobrun tobrun added the Core The cross-platform C++ core, aka mbgl label Jun 12, 2019
@tmpsantos
Copy link
Contributor

@jdale38 could you please provide us the style + data example? That would make a lot easier to bisect the issue.

@pozdnyakov
Copy link
Contributor

@jdale38 could you also give more details on how much FPS got lowered?

@jdale38
Copy link
Author

jdale38 commented Jun 12, 2019

@tmpsantos we've authored our own style and host our own data. Number details include 14 sources, 10 of them being raster sources, 4 vector. Paired with 3000+ layers, 10 layers being raster, the rest referencing vector sources. We are also hosting our own sprites and glyphs. During normal usage, 2-4 raster layers are visible. As for vector layer types, there could be 250-400 layers visible (symbol, line, fill).

@pozdnyakov before v7.4.0-alpha.2 would hover around 40-50 fps. v7.4.0-alpha.2 or greater hovers around 12-15 fps. Testing the same area at the same zoom level with the same features/layers visible. Using MapboxMap#setOnFpsChangedListener via the Android SDK to report the map view's FPS.

Also, during a pan/scroll/zoom event, FPS would drop below 10 fps. Close to 5 fps. Using the same reporting from the Android SDK to verify.

Tested on Google Pixel, Android 9.

@tmpsantos
Copy link
Contributor

tmpsantos commented Jun 12, 2019

@jdale38 if granting us access to your style/tile endpoint is not an option, could you please provide us a test style using Mapbox tiles (streets, terrain, etc) that could be used for reproducing this regression?

We will be more than happy to investigate the issue and even include this style to our benchmark to prevent future regressions.

@mgd4
Copy link

mgd4 commented Sep 23, 2019

Recently, I came across rendering performance drop which seems to be connected with the commit stated at the beginning of this conversation.
Apparently, in my setup, getRenderLayer() signifficantly contributes to the execution time. After the change it is called layerImpls.size() * sourceImpls.size() times, before the commit it was something like layerImpls.size() * 2.
My style contains around 20 sources and a bit more than 1000 layers, and I must admit that layer IDs are quite long e.g. 50 characters.

@pozdnyakov
Copy link
Contributor

Apparently, in my setup, getRenderLayer() signifficantly contributes to the execution time

@mgd4 Thanks for the hint! @jdale38 @mgd4 Pls tell if #15756 fixes the problem for you.

@stale stale bot added the archived Archived because of inactivity label Mar 31, 2020
@stale
Copy link

stale bot commented Mar 31, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

5 participants