Repository navigation
Conversation
Add a :baselineprofile module that generates the profiles from the demo app, and a BaselineProfileConventionPlugin that packages them in the library, ui, clustering, heatmaps and data AARs, keeping only each module's own classes. It also contains a StartupBenchmark to measure the effect.
…nerated profiles in the header check
Contributor
Code Coverage
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
None of the library modules ship a Baseline Profile today, so apps using them run clustering, the GeoJSON/KML parsers and the polyline utilities interpreted/JIT until ART compiles them. This PR adds the profiles and the tooling to regenerate them, same approach as googlemaps/android-maps-compose#1063.
:baselineprofilemodule (com.android.test, Benchmark 1.5.0) targeting thestandardflavor ofdemo.BaselineProfileGeneratoropens the demos that cover the public API (poly decode/simplify, flexible polyline, distance, KTX extensions, IconGenerator, clustering, big and custom marker clustering, zoom clustering, heatmaps, GeoJSON, KML and multi layer) and pans and zooms the map in each one.BaselineProfileConventionPlugininbuild-logic, applied tolibrary,ui,clustering,heatmapsanddata. The generatedsrc/main/generated/baselineProfiles/baseline-prof.txtgets packaged in each AAR: data 688 rules, clustering 197, library 104, heatmaps 52 and ui 37.StartupBenchmarkcompares frame timing of the big clustering and heatmaps demos withCompilationMode.Noneagainst the Baseline Profiles. To run on a physical device:./gradlew :baselineprofile:connectedBenchmarkReleaseAndroidTest.A few points worth to mention
com.google.maps.android.ktx.utils.*), and the plugin filter only supportspkg.**,pkg.*or exact class names. So the convention plugin includescom.google.maps.android.**and, aftercopyBaselineProfileIntoSrc, drops every rule whose class the module does not compile (Kotlin and Java outputs; D8$$ExternalSynthetic*and$-CCclasses are kept for their owner). No class ends up in two modules and no demo class ends up in any.nonMinifiedReleaseandbenchmarkReleasein the app, and the generation then silently runs 0 tests. They are declared explicitly indemo/build.gradle.ktswith the settings the plugin would apply (not minified, not debuggable, profileable, debug signing). We can drop them once the plugin handles it.androidx.baselineprofileis on the rootbuildscriptclasspath next to AGP, and inbuild-logicto compile the convention plugin.am start -Winstead ofstartActivityAndWait, which could not confirm the launch on the map screens. Street View is not part of the journey.MAPS_API_KEY: with a placeholder the demos close themselves and the profiles come out almost empty..modulehave no reference to:baselineprofile.Testing
baseline-prof.txtis present in the five release AARs.spotlessCheck,build,apiCheck,koverXmlReportDebug,:library:lintDebugand:demo:lintStandardDebugpass locally.