Meningkatkan Performa Aplikasi dengan Profil Baseline
Meningkatkan Performa Aplikasi dengan Profil Baseline
Atau cara meningkatkan waktu startup hingga 40%
Diposting oleh Kateryna Semenova, DevRel Engineer; Rahul Ravikumar, Software Engineer; Chris Craik, Software Engineer
Mengapa waktu startup sangatlah penting?
Banyak aplikasi menemukan korelasi antara performa aplikasi dan interaksi pengguna. Orang-orang mengharapkan aplikasi yang responsif dan cepat dimuat. Waktu startup adalah salah satu metrik utama untuk menilai performa dan kualitas aplikasi.
Beberapa mitra kami menginvestasikan banyak waktu dan sumber daya untuk optimalisasi startup aplikasi. Sebagai contoh, lihat cerita Facebook.
Dalam postingan blog ini kita akan membahas Profil Baseline dan cara kerjanya dalam meningkatkan performa aplikasi dan library, termasuk waktu startup hingga 40%. Meskipun postingan blog ini berfokus pada startup, profil baseline juga meningkatkan jank secara signifikan.
Histori
Android 9 (API level 28) memperkenalkan profil optimalisasi ART di Play Cloud untuk meningkatkan waktu startup aplikasi. Rata-rata, kami melihat cold start aplikasi setidaknya 15% lebih cepat di berbagai perangkat bila Profil Cloud tersedia.
Bagaimana cara kerja Profil?
Saat aplikasi pertama kali diluncurkan setelah penginstalan atau update, kodenya berjalan dalam mode interpreted hingga di-JIT. Dalam APK, kode Java dan Kotlin dikompilasi sebagai bytecode dex, tetapi tidak sepenuhnya dikompilasi ke kode mesin (sejak Android 6), karena biaya penyimpanan dan pemuatan aplikasi yang dikompilasi sepenuhnya. Class dan metode yang sering digunakan dalam aplikasi, serta yang digunakan untuk startup aplikasi, direkam ke dalam file profil. Setelah perangkat memasuki mode idle, ART mengompilasi aplikasi berdasarkan profil-profil ini. Hal ini mempercepat peluncuran aplikasi berikutnya.
Dimulai dengan Android 9 (API level 28), Google Play juga menyediakan Profil Cloud. Saat aplikasi berjalan di perangkat, profil yang dihasilkan oleh ART diupload oleh aplikasi Play Store dan dikumpulkan di cloud. Setelah ada cukup profil yang diupload untuk suatu aplikasi, aplikasi Play akan menggunakan profil yang dikumpulkan untuk penginstalan berikutnya.
Masalah
Meskipun Profil Cloud sangatlah bagus bila tersedia, profil ini tidak selalu siap digunakan saat aplikasi diinstal. Mengumpulkan dan menggabungkan profil biasanya memakan waktu beberapa hari, yang merupakan masalah ketika banyak aplikasi diupdate setiap minggu. Banyak pengguna akan menginstal update sebelum Profil Cloud tersedia. Tim Google Android mulai mencari cara lain untuk memperbaiki latensi profil.
Solusi
Profil Baseline adalah mekanisme baru untuk menyediakan profil yang dapat digunakan di Android 7 (API level 24) dan yang lebih tinggi. Profil baseline adalah profil ART yang dihasilkan oleh plugin Android Gradle menggunakan format profil yang dapat dibaca manusia dan dapat disediakan oleh aplikasi serta library. Contohnya terlihat seperti ini:
HSPLandroidx/compose/runtime/ComposerImpl;->updateValue(Ljava/lang/Object;)V HSPLandroidx/compose/runtime/ComposerImpl;->updatedNodeCount(I)I HLandroidx/compose/runtime/ComposerImpl;->validateNodeExpected()V PLandroidx/compose/runtime/CompositionImpl;->applyChanges()V HLandroidx/compose/runtime/ComposerKt;->findLocation(Ljava/util/List;I)I
Contoh untuk library Compose.
Profil biner disimpan di lokasi tertentu dalam direktori aset APK (assets/dexopt/baseline.prof).
Profil Baseline dibuat pada waktu build, dikirimkan sebagai bagian dari APK ke Play, lalu dikirim dari Play ke pengguna saat aplikasi didownload. Mereka mengisi celah di pipeline Profil Cloud ART, saat Profil Cloud belum tersedia, dan secara otomatis bergabung dengan Profil Cloud saat sudah tersedia.
Diagram ini menampilkan alur kerja profil baseline dari pembuatan hingga pengiriman ke pengguna akhir.
Salah satu keuntungan terbesar dari Profil Baseline adalah bisa dikembangkan dan dievaluasi secara lokal sehingga developer dapat melihat peningkatan performa pengguna akhir yang realistis. Profil ini juga didukung pada versi Android yang lebih rendah (7 dan yang lebih tinggi) daripada Profil Cloud, yang hanya tersedia mulai Android 9.
Dampak
Developer aplikasi
Pada awal 2021, Google Maps beralih dari siklus rilis dua minggu ke satu minggu. Semakin sering mengupdate semakin sering pra-kompilasi lokal dihapus, dan semakin banyak pengguna yang mengalami peluncuran lambat tanpa Profil Cloud Play. Dengan menggunakan Profil Baseline, Google Maps meningkatkan waktu startup rata-rata sebesar 30% dan mengalami peningkatan yang sama dalam penelusuran sebesar 2,4%, keuntungan yang sangat besar untuk aplikasi yang sudah mapan.
Developer library
Kode dalam library sama seperti aplikasi - tidak sepenuhnya dikompilasi secara default, yang bisa menjadi masalah ketika melakukan pekerjaan yang signifikan di jalur kritis saat startup.
Jetpack Compose adalah library UI yang bukan bagian dari image sistem Android sehingga tidak sepenuhnya dikompilasi saat diinstal, tidak seperti kebanyakan kode toolkit Android View. Hal ini menyebabkan masalah performa, terutama untuk beberapa cold-launch aplikasi.
Untuk mengatasi masalah ini, Compose menggunakan installer profil. Hal ini akan mengirimkan aturan profil baseline yang mengurangi waktu startup dan jank di aplikasi Compose.
Halaman hasil penelusuran Google PlayStore telah ditulis ulang dengan Compose. Setelah memasukkan aturan Profil Baseline dari Compose, waktu render halaman hasil penelusuran awal dengan gambar meningkat sebesar ~40%.
Tim Android juga telah menambahkan Profil Baseline ke library AndroidX yang relevan. Hal ini menguntungkan semua aplikasi Android yang menggunakan library ini. Constraint Layout menemukan bahwa aturan profil pengiriman mengurangi waktu render frame animasi lebih dari satu milidetik.
Cara menggunakan Profil Baseline
Buat Profil Baseline khusus
Semua developer aplikasi dan library bisa memanfaatkan penyertaan Profil Baseline. Idealnya, developer membuat profil untuk penjelajahan pengguna yang paling penting untuk memastikan penjelajahan tersebut memiliki performa yang cepat secara konsisten terlepas dari apakah profil cloud tersedia. Lihat panduan detail tentang cara menyiapkan Profil Baseline untuk developer aplikasi dan library.
Update dependensi
Jika Anda belum siap membuat Profil Baseline untuk aplikasi sekarang, Anda masih bisa memanfaatkannya dengan mengupdate dependensi. Jika Anda membangun dengan Plugin Android Gradle 7.1.0-alpha05 atau yang lebih baru, Anda akan mendapatkan Profil Baseline yang disertakan dalam APK yang sudah disediakan oleh library (seperti Jetpack). Google Play mengompilasi aplikasi Anda dengan profil ini pada waktu penginstalan. Anda bisa melengkapi profil ini sebagai bagian dari pembangunan aplikasi.
Ukur Peningkatan
Jangan lupa mengukur peningkatan. Ikuti langkah-langkah tentang cara mengukur startup dengan profil yang dibuat secara lokal.
Berikan masukan
Silakan berikan masukan dan ceritakan pengalaman Anda!
Informasi yang menarik sekali Slot Zeus
ReplyDeleteWhy Choose Luxequality
ReplyDelete1. Experienced Team
Our team of seasoned quality assurance experts is at the heart of our success. We bring decades of collective experience, ensuring your business benefits from the best practices and insights in the industry.
2. Cutting-Edge Technology
We stay at the forefront of technology and tools, continuously investing in state-of-the-art equipment and methodologies to deliver the highest level of quality assurance.
3. Customized Solutions
Every business is unique, and our approach reflects this. Luxequality - quality assurance services company tailors its services to meet your specific needs, providing customized quality assurance solutions that are efficient and cost-effective.
4. Proven Track Record
Our track record speaks for itself. Luxequality has helped numerous businesses achieve excellence in quality assurance, enabling them to soar above their competitors.
Online games www.casinoszondercruksonline.com zijn enorm populair geworden en bieden spelers de mogelijkheid om in virtuele werelden te duiken en uitdagingen aan te gaan, alleen of met vrienden. Ze variëren van simpele puzzels tot complexe multiplayer games die strategisch denken en teamwork vereisen. Bovendien maken deze spellen interactie en competitie met spelers over de hele wereld mogelijk, wat bijdraagt aan een rijke en dynamische speelervaring.
ReplyDeleteThat's amaizng post sharing regard Invisible text
ReplyDeleteThis google blog is amazing sharing amazing tips and trick regarding mp3juices 20
ReplyDeleteFor added convenience in your digital tasks, you might also want to explore https://invisibletext.co/. This site offers mod APK downloads that can enhance your text management and customization capabilities, making it easier to handle various digital projects efficiently.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThat's amaizng post sharing regard Invisible text
ReplyDeleteIf you're an Android user seeking the best APK apps and games, **Premium apps** ([https://goapks.com/apps]) is the perfect destination. It offers a vast collection of downloadable apps and games, providing a simple and user-friendly experience. Whether you're looking for the latest updates, unique games, or helpful tools, GOAPKS ensures that you can easily find and install everything you need in one place. Explore their extensive library today for a smooth and reliable Android experience!
ReplyDeleteIf you're an Android user seeking the best APK apps and games, **Premium apps** ([https://goapks.com/apps](https://goapks.com/)) is the perfect destination. It offers a vast collection of downloadable apps and games, providing a simple and user-friendly experience. Whether you're looking for the latest updates, unique games, or helpful tools, GOAPKS ensures that you can easily find and install everything you need in one place. Explore their extensive library today for a smooth and reliable Android experience!
ReplyDeleteIf you're an Android user seeking the best APK apps and games, [premium apps](https://goapks.com/apps) is the perfect destination. It offers a vast collection of downloadable apps and games, providing a simple and user-friendly experience. Whether you're looking for the latest updates, unique games, or helpful tools, GOAPKS ensures that you can easily find and install everything you need in one place. Explore their extensive library today for a smooth and reliable Android experience!
ReplyDeleteI’m usually good at writing, but when it came to my job application, I wanted an expert touch. SOP Services https://www.sopservices.net/sample-sop-for-phd/ did an amazing job. They understood my background and aspirations perfectly and helped me write an SOP that’s professional, concise, and impactful. If you’re on the job hunt and need help with your SOP, they’ve got your back!
ReplyDeleteI appreciate the insights shared in this post about the evolving landscape of app development. It's exciting to see how platforms are prioritizing developer needs and user experiences. For anyone looking to explore innovative solutions, I recommend checking out https://v1.streameast.buzz/ which offers a unique approach to streaming and content delivery. Keep up the great work!
ReplyDeleteGreat insights on enhancing app development efficiency! I've been exploring tools that assist in creating clean and optimized code, and one that stands out is https://invisibletext.net/ . It’s a handy resource for developers looking to manage text-related data more effectively without cluttering the interface. Keep up the informative content!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI really value the insights in this post about the changing landscape of app development. It's great to see platforms focusing on both developer needs and user experiences. If you're looking for innovative solutions, I encourage you to explore unique approaches to streaming and content delivery. Keep up the fantastic work!https://multipackinternational.com/
ReplyDeleteMeningkatkan performa aplikasi dengan profil baseline adalah langkah penting untuk pengalaman pengguna yang lebih baik. Untuk menjelajahi aplikasi dan alat terbaik yang dapat membantu kinerja, kunjungi https://apkpure.com.
ReplyDeleteProtect your online accounts and personal data with ease using our [Secure Online Password Generator](https://passwortgenerator.live/). This powerful tool allows you to create strong, random, and secure passwords instantly, ensuring your accounts remain safe from unauthorized access. Whether you need a password for your social media, email, or any other online platform, this generator provides a quick and reliable solution. Customize the length and complexity of your passwords to suit your specific security requirements. Visit the website today and enhance your online security effortlessly.
ReplyDeleteThis article explains how to make your app start faster by using Baseline Profiles. By adding special profiles for the most important user actions, your app can run smoothly even before Cloud Profiles are available. This method helps reduce startup time and makes your app more responsive. The article is clear and easy to understand.
ReplyDeleteBy the way, if you're looking for a delicious meal to enjoy after a long day of app development, Jollibee's Mix and Match offers a variety of tasty options.
Waktu startup penting karena menentukan pengalaman pengguna, efisiensi, daya saing, performa, dan peluang pasar. Makin cepat, makin baik.Sure! What keyword would you like me to add while keeping the text clear and concise like Hemingway Editor suggests? 🚀
ReplyDeleteGreat insights on Google developer updates! Keeping up with these advancements is crucial for developers looking to enhance their projects. For those interested in exploring more about technology and development, check out https://randygoodwin.org/for additional resources and insights.
ReplyDeleteOptimasi waktu startup sangat penting untuk meningkatkan pengalaman pengguna dan retensi aplikasi. Dengan menggunakan Profil Baseline, pengembang dapat memastikan performa aplikasi tetap optimal sejak pertama kali diinstal, tanpa harus menunggu Profil Cloud tersedia. Ini membantu mengurangi latensi dan meningkatkan kecepatan startup hingga 40%. Untuk pembahasan lebih lanjut, cek texto invisible.
ReplyDeleteOptimizing app performance is crucial for user satisfaction, especially in high-demand industries like real estate. For example, platforms supporting luxury developments like Al Marjan Island in Dubai rely on fast, responsive apps to deliver seamless virtual tours and property experiences.
ReplyDelete