|Jetpack Compose Improves Performance
|Written by Kay Ewbank
|Tuesday, 30 January 2024
Google has released version 1.6 of Jetpack Compose as part of its larger Compose January '24 Bill of Materials release. Google says this release largely focuses on performance improvements, courtesy of continued migration modifiers and improvement of the efficiency of major parts of the underlying API.
Android Jetpack is a suite of libraries for use in Android app development, and Compose is Android's modern, native UI toolkit that is Google's recommended way to build new Android apps for phone, tablets and foldables, and the addition of Compose for Wear adds the option of building Wear OS apps too.
The performance improvements, according to Google, have resulted in around a twenty percent improvement in scroll performance and a twelve percent improvement in startup time in Google's benchmarks, on top of the improvements from the August '23 release. The developers say that as with the earlier release, most apps will see these benefits just by upgrading to the latest version, with no other code changes needed.
The improvements have come from work on memory allocations and lazy initialization, to ensure the framework is only doing work when it has to.
The new version also includes an updated Compose compiler that has a new option that can be used to mark any class as stable, including your own modules, external library classes, and standard library classes, without having to modify these modules or wrap them in a stable wrapper class.
The code generated by the Compose compiler plugin has also been improved, providing more performance improvements, and to enable "intrinsic remember" by default. This means the compiler remembers to take into account information it already has about any parameters of a composable, so speeding up the calculation of determining if a remembered expression needs reevaluating.
The developers say they have also added support for an experimental mode called "strong skipping mode" that relaxes some of the rules about which changes can skip recomposition, moving the balance towards what developers expect. With strong skipping mode enabled, composables with unstable parameters can also skip recomposition if the same instances of objects are passed in to its parameters.
Jetpack Compose 1.6 is available now.
or email your comment to: email@example.com
|Last Updated ( Tuesday, 30 January 2024 )