HomeAndroidWhat’s new in Android Efficiency — Google I/O 2023 version | by...

What’s new in Android Efficiency — Google I/O 2023 version | by Ben Weiss | Android Builders | Could, 2023


The Macrobenchmark library allows you to measure app efficiency, create baseline profiles and monitor whether or not adjustments to your app make a distinction to app efficiency. The 1.2.0 will graduate to a beta launch quickly. Listed here are some characteristic highlights.

From Android 13 and newer you possibly can generate a Baseline Profile with the BaselineProfileRule on non-rooted gadgets or emulators.

From Android 14 and newer, goal apps not have to be reinstalled between benchmark runs. This permits apps to save lots of state, akin to cache, session state or login tokens between runs. This transformation removes the necessity to inject these states manually earlier than benchmarking, which might have required a rooted machine.

New APIs

✨ Baseline Profile era is not thought-about experimental ✨

You’ll be able to take away the opt-in to experimental API annotation out of your code when making a baseline profile utilizing the collectBaselineProfile technique. However in the event you like to remain on experimental APIs, we’ve got a brand new API in your consideration.

The newly launched collectStableBaselineProfile runs and waits till a profile is taken into account secure for a given quantity of iterations. Which means your app’s Baseline Profile will higher replicate what’s happening in your app as a code path is executed.

Extra highly effective metrics with customized hint processing

PerfettoTraceRule allows customized hint assortment in checks apart from benchmarks (requires API 23+). It is a highly effective characteristic that can permit customers to gather efficiency and timing knowledge about checks.

PerfettoTraceProcessor allows querying hint contents, and is the engine behind all the current Macrobenchmark Metric APIs. Now it’s potential to make use of it with TraceMetric to outline absolutely customized metrics in the identical approach Macrobenchmark does from something info in a Perfetto system hint.. That is one other highly effective characteristic that can permit customers to customise their benchmarks even additional.

The brand new PowerMetric API can be utilized to measure power consumption and energy states. It is a helpful characteristic that can permit customers to trace the power consumption of their benchmarks.

The group behind Macrobenchmark additionally made a wide range of different enhancements to ergonomics, mounted bugs and improved total conduct. To study extra, try the documentation. If you wish to get extra element, you’ll find a full listing of launch notes with hooked up code and monitoring points right here.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments