{"id":785,"date":"2019-04-25T19:39:21","date_gmt":"2019-04-25T19:39:21","guid":{"rendered":"http:\/\/www.smart-bricks.net\/?p=785"},"modified":"2019-04-28T22:23:11","modified_gmt":"2019-04-28T22:23:11","slug":"art-cloud-profiling-to-improve-android-app-performance","status":"publish","type":"post","link":"http:\/\/www.smart-bricks.net\/index.php\/2019\/04\/25\/art-cloud-profiling-to-improve-android-app-performance\/","title":{"rendered":"ART Cloud Profiling to Improve Android App Performance"},"content":{"rendered":"\n<p>First introduced in Android Pie, <a href=\"https:\/\/youtu.be\/Yi9-BqUxsno?list=PLWz5rJ2EKKc9Gq6FEnSXClhYkWAStbwlC&amp;t=985\">ART optimizing profiles<\/a> are a feature that leverages data sent to Play Cloud to optimize an app startup time on install or update. <a href=\"https:\/\/android-developers.googleblog.com\/2019\/04\/improving-app-performance-with-art.html\">Data disclosed by Google show&nbsp;apps start&nbsp;15% faster on average<\/a>, with special cases reaching a 30% improvement.<\/p>\n\n\n\n<p>Android has supported runtime optimization features since Android Nougat using <a href=\"https:\/\/source.android.com\/devices\/tech\/dalvik\/jit-compiler\">Profile Guided Optimization<\/a>\n (PGO). This technology was able to carry through an in-app profiling of\n memory and storage usage and to identify hot code. The downside of PGO \nis it only relies on data for that single device\/user, which makes the \noptimization process quite slow. By aggregating data coming from a \nmultiplicity of users and devices in Play Cloud, ART profiling \nsignificantly speeds up this process and makes its outcome available for\n all users alike.<\/p>\n\n\n\n<p>This approach becomes even more interesting when one thinks that in \nmany cases developers roll out their apps incrementally. This makes it \npossible to profile a new version in the initial roll-out phase and to \nidentify hot code and optimization opportunities the rest of the users \ncan benefit from without any delay.<\/p>\n\n\n\n<p>To make this mechanism possible, the profiling phase, which happens in Play Cloud, produces a <strong>core code profile<\/strong>,\n which contains anonymous aggregate data about the most frequent code \npaths, about which classes are loaded at startup, and which code \nexecutes at startup and which later. Code profiles can be installed on \ndevices from the Play Cloud using .dex metadata files, which are \ncompletely transparent to developers.<\/p>\n\n\n\n<p>Using the information in code profiles, Google uses a number of techniques to improve app performance, including <a href=\"https:\/\/youtu.be\/fwMM6g7wpQ8?t=2145\">app images<\/a>, code pre-compilation, and bytecode re-layout.<\/p>\n\n\n\n<p>App images are a memory map of pre-initialized classes that are used \nat startup. The image is directly mapped to the memory heap on launch. \nSimilarly, code-precompilation targets code that is executed when the \napp launches. This code is precompiled and optimized, sparing thus the \ntime it takes for the JIT compiler to do its job. Finally, the bytecode \nre-layout of an app aims to keep close together code that is used at \nstartup, code that is used immediately after startup, and the rest of \nthe code, thus improving loading times.<\/p>\n\n\n\n<p>As mentioned, according to Google the average startup time is 15% \nfaster after ART profiling optimization, with many apps reaching 20%. \nBesides Google apps, more than 30,000 apps have shown improvements.<\/p>\n\n\n\n<p>As a next step in the development of ART profiling, Google will aim \nto make this kind of information available to developers, so they can \nimprove their apps based on real performance data from users.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First introduced in Android Pie, ART optimizing profiles are a feature that leverages data sent to Play Cloud to optimize an app startup time on install or update. Data disclosed by Google show&nbsp;apps start&nbsp;15% faster on average, with special cases reaching a 30% improvement. Android has supported runtime optimization features since Android Nougat using Profile&hellip;&nbsp;<a href=\"http:\/\/www.smart-bricks.net\/index.php\/2019\/04\/25\/art-cloud-profiling-to-improve-android-app-performance\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">ART Cloud Profiling to Improve Android App Performance<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":70,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1],"tags":[33,26],"class_list":["post-785","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-andoid","tag-google"],"_links":{"self":[{"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/posts\/785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/comments?post=785"}],"version-history":[{"count":1,"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/posts\/785\/revisions"}],"predecessor-version":[{"id":786,"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/posts\/785\/revisions\/786"}],"wp:attachment":[{"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/media?parent=785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/categories?post=785"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.smart-bricks.net\/index.php\/wp-json\/wp\/v2\/tags?post=785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}