Newsletter
REAL HACKER NEWS
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO
No Result
View All Result
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO
No Result
View All Result
REAL HACKER NEWS
No Result
View All Result
Home APPLICATIONS

Accurately Measure Android App Performance with Profileable Builds

Real Hacker Staff by Real Hacker Staff
November 17, 2022
in APPLICATIONS
0
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter

Related articles

A mobile gaming subscription war looms as Netflix sets its sights on Apple Arcade

A mobile gaming subscription war looms as Netflix sets its sights on Apple Arcade

March 20, 2023

New DotRunpeX Malware Delivers Multiple Malware Families via Malicious Ads

March 20, 2023



Posted by Yi Yang (Software program Engineer)
It’s essential to remain on high of your app efficiency to ensure your customers can simply use your app. When an app experiences points resembling animation jank, frozen frames, and excessive reminiscence utilization, it negatively impacts the consumer expertise which may result in decrease rankings or app deletion. To repair these efficiency points, we first want the proper instruments to measure app efficiency appropriately.

The debug construct lets you use options helpful for improvement, like Apply Adjustments, working with the debugger, or the Database Inspector. As well as, it additionally permits profiling instruments to examine the state of a working app unavailable to the discharge construct.

Underneath the hood, the debug construct units the debuggable flag within the Android Manifest to true.

Whereas helpful, the debug construct is supposed to offer extra data at the price of efficiency. That’s as a result of when debuggable is true, lots of compiler optimizations are turned off.

Screenshot of the Profile HWUI rendering setting in Developer Options. The option is in Developer Options > Monitoring > Profile HWUI rendering > On screen as bars

To indicate you the efficiency distinction between the debug and launch builds, we recorded an app working on the identical machine however in these two construct variants. To visualise the body rendering time, we turned on Profile GPU Rendering (or Profile HWUI rendering in some Android variations) in Developer Choices when recording the display screen. Every vertical bar on the underside of the display screen represents how lengthy every body takes to render. The shorter these bars are, the smoother the animation is.

The display screen recording beneath reveals the identical app working on the identical machine. The left-hand facet is on a debug construct, the right-hand facet a launch construct. The debug model has extra stuttering frames, often known as UI jank. This implies once you profile the debug construct, you may even see timing measurements considerably totally different from what your customers see within the launch construct, and you could find yourself optimizing one thing that isn’t the issue.

GIF showing the performance difference between debug and release builds

To deal with that subject, the Android platform launched a tag known as profileable. It permits many profiling instruments that measure timing data, with out the efficiency overhead of the debug construct. Profileable is on the market on gadgets working Android 10 or increased.

AndroidManifest.xml

<software>
    <profileable android:shell=[“true” | “false”] />
</software>

Let’s take a look at one other display screen recording. This time, the left facet reveals a profileable launch app and the proper facet an unmodified launch app. There’s little efficiency distinction between the 2.

GIF showing the performance difference between profileable and release builds

With profileable, now you can measure the timing data far more precisely than the debug construct.

This characteristic is designed for use in manufacturing the place app safety is paramount. Due to this fact we determined to solely assist profiling options resembling Callstack Sampling and System Hint, the place timing measurement is crucial. The Reminiscence Profiler solely helps Native Reminiscence Profiling. The Vitality Profiler and Occasion Timeline are usually not accessible. The whole checklist of disabled options may be discovered right here. All these restrictions are put in place to maintain your app’s information protected.

Now that you already know what the profileable tag does, let me present you the right way to use it. There are two choices: robotically and manually.

Choice 1: Use the choice in Android Studio.

With Android Studio Flamingo and Android Gradle Plugin 8.0, all it’s worthwhile to do is simply choose this selection from the Profile dropdown menu within the Run toolbar: “Profile with low overhead”. Then Android Studio will robotically construct a profileable app of your present construct kind and fasten the profiler. It really works for any construct kind, however we extremely advocate you to profile a launch construct, which is what your customers see.

Screenshot of the one-click profileable builds feature in Android Studio Flamingo Canary

When a profileable app is being profiled, there’s a visible indicator together with a banner message. Solely the CPU and Reminiscence profilers can be found.

Screenshot of Android Studio profiler profiling a profileable build

Within the Reminiscence Profiler, solely the native allocation recording characteristic is on the market on account of safety causes.

Screenshot showing Android Studio memory profiler features when profiling a profileable build

This characteristic is nice for simplifying the method of native profiling however it solely applies once you profile with Android Studio. Due to this fact, it might nonetheless be useful to manually configure your app in case you need to diagnose efficiency points in manufacturing or in the event you’re not prepared to make use of the newest model of Android Studio or Android Gradle plugin but.

Choice 2: Guide configuration.

It takes 4 steps to manually allow profileable.

1.    Add this line to your AndroidManifest.xml.

 AndroidManifest.xml

<software>
  <profileable android:shell=“true” />
</software>

2.    Swap to the discharge construct kind (or any construct kind that’s not debuggable).

Screenshot of selecting the active build variant in Android Studio

3.    Be sure you have a signing key configured. To forestall compromising your launch signing key, you possibly can quickly use your debug signing key, or configure a brand new key only for profiling.

 

 

  

 

4.    Construct and run the app on a tool working Android 10 or increased. You now have a profileable app. You may then connect the Android Studio profiler by launching the Profiler device window and choosing the app course of from the dropdown checklist.

Screenshot of process selection in Android Studio profilersLots of you could surprise whether it is protected to depart the profileable manifest tag in manufacturing and the reply is sure. This tag is designed to be usable in launch builds to allow native profiling. No reminiscence information is readable by the host profiling instruments and the shell course of. Solely stack traces are readable, that are usually obfuscated or missing symbols in launch builds.

Actually, many first-party Google apps resembling Google Maps ship their app to the Play Retailer as profileable apps.

Screenshot showing Google Maps as a profileable process in the profiler process dropdownIn abstract, profiling the debug construct could skew the efficiency and due to this fact it’s higher to investigate the discharge construct with the profileable tag enabled.

Right here’s a desk that reveals which construct kind must be used:

Launch Profileable Launch Debug
Manufacturing Profiling CPU timing Debugger, Inspectors, and so on.

Profiling reminiscence, power, and so on.

To study extra about profilable builds, begin by studying the documentation and the the consumer information.

With these instruments offered by the Android crew, we hope you can also make your app run sooner and smoother.



Source link

Tags: AccuratelyAndroidAppbuildsMeasureperformanceProfileable
Share76Tweet47

Related Posts

A mobile gaming subscription war looms as Netflix sets its sights on Apple Arcade

A mobile gaming subscription war looms as Netflix sets its sights on Apple Arcade

by Real Hacker Staff
March 20, 2023
0

Microsoft and Netflix are ready to take on Apple in the mobile gaming space — and the first shots have...

New DotRunpeX Malware Delivers Multiple Malware Families via Malicious Ads

by Real Hacker Staff
March 20, 2023
0

Mar 20, 2023Ravie LakshmananCyber Threat / Malware A new piece of malware dubbed dotRunpeX is being used to distribute numerous...

Russia’s Kremlin bans iPhones as Putin’s workers fear espionage threat

by Real Hacker Staff
March 20, 2023
0

Russians working on President Putin's 2024 re-election campaign have been told that they cannot use an iPhone over espionage fears.Workers...

New Cyber Platform Lab 1 Decodes Dark Web Data to Uncover Hidden Supply Chain Breaches

by Real Hacker Staff
March 20, 2023
0

Mar 20, 2023The Hacker NewsData Breach / Dark Web This article has not been generated by ChatGPT. 2022 was the...

Twitter replies are changing in attempt to combat spam, but also to promote Twitter Blue

by Real Hacker Staff
March 20, 2023
0

Nowadays, every development surrounding Musk’s takeover of Twitter feels like a brand new installment of a drama series. One of...

Load More
  • Trending
  • Comments
  • Latest

eSIMs Will Transform the Way You Think About Mobile Data and Security

March 7, 2023

Sennheiser Starts Shipping EW-DX Digital Wireless Microphone Series

November 22, 2022

Chinese Hackers Using Russo-Ukrainian War Decoys to Target APAC and European Entities

December 7, 2022

Spitfire Audio unveils Aperture: Cassette Symphony

November 25, 2022

Hello world!

0
US Commodities Regulator Beefs Up Bitcoin Futures Review

US Commodities Regulator Beefs Up Bitcoin Futures Review

0
Bitcoin Hits 2018 Low as Concerns Mount on Regulation, Viability

Bitcoin Hits 2018 Low as Concerns Mount on Regulation, Viability

0
India: Bitcoin Prices Drop As Media Misinterprets Gov’s Regulation Speech

India: Bitcoin Prices Drop As Media Misinterprets Gov’s Regulation Speech

0
Tecno Phantom V Fold review

Tecno Phantom V Fold review

March 20, 2023
PSA: You Only Have One Week To Purchase 3DS And Wii U eShop Games

PSA: You Only Have One Week To Purchase 3DS And Wii U eShop Games

March 20, 2023
A mobile gaming subscription war looms as Netflix sets its sights on Apple Arcade

A mobile gaming subscription war looms as Netflix sets its sights on Apple Arcade

March 20, 2023
AWS takes a hit in latest round of Amazon layoffs

AWS takes a hit in latest round of Amazon layoffs

March 20, 2023

Recent News

Tecno Phantom V Fold review

Tecno Phantom V Fold review

March 20, 2023
PSA: You Only Have One Week To Purchase 3DS And Wii U eShop Games

PSA: You Only Have One Week To Purchase 3DS And Wii U eShop Games

March 20, 2023

Categories

  • APPLICATIONS
  • AUDIO
  • CAMERA
  • COMPUTERS
  • GAMING
  • LAPTOP
  • REVIEWS
  • SECURITY
  • SMARTPHONES
  • Uncategorized
REAL HACKER NEWS

We bring you the best news on Internet new gadgets hacking and technology from around the world

  • Contact
  • Cookie Privacy Policy
  • Terms and Conditions
  • Privacy Policy
  • Disclaimer
  • DMCA

© 2003 Real Hacker News

No Result
View All Result
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO

© 2003 Real Hacker News

Go to mobile version