commit | de21a970b02cda8eaffe2882f3adb39e26eb0b0b | [log] [tgz] |
---|---|---|
author | Romain Guy <[email protected]> | Thu Mar 09 16:42:35 2023 -0800 |
committer | Romain Guy <[email protected]> | Fri Mar 10 15:50:25 2023 -0800 |
tree | 72fcf3413fe88df1b0e00668f5864ec3db0a69a9 | |
parent | eb0165e9ac74902b0b7d9c4f7d1d3edb2548fd08 [diff] |
Improve VectorDrawable's parsing performance This new implementation does three things to speed up parsing: - Use a faster float parsing algorithm. This algorithm doesn't attempt to handle all use cases (in particular, it does not try to parse NaN/Infinity) but it covers the cases that matter in this domain. - The parsing of path data is now linear: the data is parsed exactly once, instead of 3 times in the previous implementation. - The new float parsing implementation treats the input string as a stream and parses until the next invalid character. This allows us to not only avoid going through the data multiple times, but it removes a significant number of allocations since String.substring is now unnecessary. A benchmark written to parse paris_30k.xml yields the following numbers: Execution time: 1.096s; Allocations: 5.356M The previous implementation (including recent optimizations) yielded: Execution time: 1.312s; Allocations: 12.045M The original implementation yielded: Execution time: 1.612s; Allocations: 16.210M Test: FastFloatParserTest Test: PathParserTest Test: VectorTest Test: ImageVectorTest Change-Id: I3eebd54f376b6ae48c7f682726ed67e8fd755c54
Jetpack is a suite of libraries, tools, and guidance to help developers write high-quality apps easier. These components help you follow best practices, free you from writing boilerplate code, and simplify complex tasks, so you can focus on the code you care about.
Jetpack comprises the androidx.*
package libraries, unbundled from the platform APIs. This means that it offers backward compatibility and is updated more frequently than the Android platform, making sure you always have access to the latest and greatest versions of the Jetpack components.
Our official AARs and JARs binaries are distributed through Google Maven.
You can learn more about using it from Android Jetpack landing page.
For contributions via GitHub, see the GitHub Contribution Guide.
Note: The contributions workflow via GitHub is currently experimental - only contributions to the following projects are being accepted at this time:
When contributing to Jetpack, follow the code review etiquette.
We are not currently accepting new modules.
Head over to the onboarding docs to learn more about getting set up and the development workflow!
Our continuous integration system builds all in progress (and potentially unstable) libraries as new changes are merged. You can manually download these AARs and JARs for your experimentation.
Before uploading your first contribution, you will need setup a password and agree to the contribution agreement:
Generate a HTTPS password: https://android-review.googlesource.com/new-password
Agree to the Google Contributor Licenses Agreement: https://android-review.googlesource.com/settings/new-agreement
AndroidX uses git to store all the binary Gradle dependencies. They are stored in prebuilts/androidx/internal
and prebuilts/androidx/external
directories in your checkout. All the dependencies in these directories are also available from google()
, or mavenCentral()
. We store copies of these dependencies to have hermetic builds. You can pull in a new dependency using our importMaven tool.