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

[core] Few performance fixes for RendererImpl #14930

Merged
merged 3 commits into from
Jul 9, 2019

Conversation

alexshalamov
Copy link
Contributor

@alexshalamov alexshalamov commented Jun 15, 2019

This PR adds following changes:

  • Reserves size of a filtered render layers container based on number of previously rendered layers
  • Provides hashed container of RenderLayer* items to qRF path to remove few linear lookups
  • Queries rendered features only from layers / sources that were provided via qRF API
--- /home/shalamov/github/mapbox-gl-native/master.json
+++ /home/shalamov/github/mapbox-gl-native/head.json
@@ -1,6 +1,6 @@
 {
   "context": {
-    "date": "2019-06-17 13:18:49",
+    "date": "2019-06-17 17:24:14",
     "executable": "./mbgl-benchmark",
     "num_cpus": 8,
     "mhz_per_cpu": 1901,
@@ -30,296 +30,296 @@
   "benchmarks": [
     {
       "name": "API_queryRenderedFeaturesAll_median",
-      "iterations": 2,
-      "real_time": 2.9258846699667627e+08,
-      "cpu_time": 2.9092940099999988e+08,
+      "iterations": 3,
+      "real_time": 2.6814993999626800e+08,
+      "cpu_time": 2.6725210366666672e+08,
       "time_unit": "ns"
     },
     {
       "name": "API_queryRenderedFeaturesLayerFromLowDensity_median",
-      "iterations": 1084,
-      "real_time": 6.4448682195356640e+05,
-      "cpu_time": 6.4066568726937275e+05,
+      "iterations": 891907,
+      "real_time": 7.8707193240672211e+02,
+      "cpu_time": 7.8502508109029293e+02,
       "time_unit": "ns"
     },
     {
       "name": "API_queryRenderedFeaturesLayerFromHighDensity_median",
-      "iterations": 97,
-      "real_time": 8.0839816907531172e+06,
-      "cpu_time": 8.0452219175257832e+06,
+      "iterations": 115,
+      "real_time": 6.5936392436370905e+06,
+      "cpu_time": 6.5608338695652150e+06,
       "time_unit": "ns"
     },
     {
       "name": "API_renderStill_reuse_map_median",
-      "iterations": 25,
-      "real_time": 3.2197530280100182e+07,
-      "cpu_time": 2.5929986279999968e+07,
+      "iterations": 24,
+      "real_time": 3.1881906374716591e+07,
+      "cpu_time": 2.5487714958333388e+07,
       "time_unit": "ns"
     },
     {
       "name": "API_renderStill_reuse_map_formatted_labels_median",
       "iterations": 24,
-      "real_time": 3.1812568290964309e+07,
-      "cpu_time": 2.5536425499999981e+07,
+      "real_time": 3.1739306541567203e+07,
+      "cpu_time": 2.5345234916666660e+07,
       "time_unit": "ns"
     },
     {
       "name": "API_renderStill_reuse_map_switch_styles_median",
       "iterations": 4,
-      "real_time": 1.8266077324369690e+08,
-      "cpu_time": 1.6953764650000024e+08,
+      "real_time": 1.8521663325373083e+08,
+      "cpu_time": 1.7134056050000003e+08,
       "time_unit": "ns"
     },
     {
       "name": "API_renderStill_recreate_map_median",
       "iterations": 4,
-      "real_time": 1.8047783050133148e+08,
-      "cpu_time": 1.6749408524999952e+08,
+      "real_time": 1.8411497925262666e+08,
+      "cpu_time": 1.6965322674999949e+08,
       "time_unit": "ns"
     }
   ]

@alexshalamov alexshalamov force-pushed the alexshalamov_small_perf_fixes branch 2 times, most recently from cab21a8 to 5d6b06a Compare June 17, 2019 08:36
@alexshalamov alexshalamov self-assigned this Jun 17, 2019
@alexshalamov alexshalamov force-pushed the alexshalamov_small_perf_fixes branch from cab21a8 to 5d6b06a Compare June 17, 2019 10:40
@alexshalamov alexshalamov changed the title [WIP][core] Few performance fixes for RendererImpl [core] Few performance fixes for RendererImpl Jun 17, 2019
@alexshalamov alexshalamov requested review from pozdnyakov, tmpsantos, astojilj and kkaefer and removed request for pozdnyakov June 17, 2019 15:13
@alexshalamov alexshalamov marked this pull request as ready for review June 17, 2019 15:13
@friedbunny friedbunny added Core The cross-platform C++ core, aka mbgl performance Speed, stability, CPU usage, memory usage, or power usage labels Jun 21, 2019
@friedbunny friedbunny added this to the release-p milestone Jun 21, 2019
@friedbunny friedbunny added the needs changelog Indicates PR needs a changelog entry prior to merging. label Jun 21, 2019
@alexshalamov alexshalamov force-pushed the alexshalamov_small_perf_fixes branch from 1cf350e to 39e6f88 Compare July 8, 2019 09:42
@alexshalamov alexshalamov requested a review from 1ec5 as a code owner July 8, 2019 09:42
@alexshalamov alexshalamov requested a review from a team July 8, 2019 09:42
@alexshalamov alexshalamov requested review from pozdnyakov and removed request for astojilj and kkaefer July 8, 2019 09:42
@alexshalamov alexshalamov removed the needs changelog Indicates PR needs a changelog entry prior to merging. label Jul 8, 2019
@alexshalamov
Copy link
Contributor Author

/cc @tobrun for Android changelog https://github.com/mapbox/mapbox-gl-native/pull/14930/files#diff-303d773d7593cfbdd7331ce896ef36af

@tobrun
Copy link
Member

tobrun commented Jul 8, 2019

/cc @tobrun for Android changelog https://github.com/mapbox/mapbox-gl-native/pull/14930/files#diff-303d773d7593cfbdd7331ce896ef36af

Looks good, thank you for adding an entry!

Copy link
Contributor

@pozdnyakov pozdnyakov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@julianrex julianrex left a comment

Choose a reason for hiding this comment

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

Looks good from my limited C++ exp. Thanks for working on this!

@alexshalamov alexshalamov force-pushed the alexshalamov_small_perf_fixes branch from 1a1b314 to c147e72 Compare July 9, 2019 07:50
@alexshalamov alexshalamov merged commit 81fc495 into master Jul 9, 2019
@alexshalamov alexshalamov deleted the alexshalamov_small_perf_fixes branch July 9, 2019 08:43
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants