Alat
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mungkin sulit untuk mengetahui lokasi masalah performa dan kode apa yang harus mulai
dioptimalkan. Mulailah dengan menggunakan alat untuk membantu mempersempit lokasi masalah Anda.
Layout Inspector
Gunakan Layout Inspector untuk memeriksa tata letak dan melihat jumlah rekomposisi.
Jika UI Anda memiliki performa yang buruk, hal ini sering kali disebabkan oleh error coding yang
memaksa UI Anda direkomposisi secara berlebihan. Di sisi lain, beberapa error coding
dapat mencegah UI Anda direkomposisi saat diperlukan, yang berarti
perubahan UI tidak muncul di layar. Melacak rekomposisi dapat
membantu menemukan kedua jenis masalah ini.
Rekomposisi itu sendiri tidak buruk; namun, rekomposisi yang tidak terduga dapat menjadi
masalah.
Untuk informasi selengkapnya, lihat dokumentasi jumlah rekomposisi
Layout Inspector.
Pelacakan komposisi
Gunakan pelacakan komposisi untuk melacak fungsi composable dalam rekaman aktivitas
sistem. Pelacakan sering kali menjadi sumber informasi terbaik saat pertama kali melihat
masalah performa. Pelacakan memungkinkan Anda membuat hipotesis tentang apa masalahnya dan
tempat untuk mulai mencarinya.
Referensi Tambahan
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-30 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-30 UTC."],[],[],null,["# Tooling\n\nIt can be hard to know where a performance issue lies and what code to start\noptimizing. Start by using tools to help narrow down where your issue is.\n\nLayout Inspector\n----------------\n\nUse the [Layout Inspector](/develop/ui/compose/tooling/debug#layout_inspector) to inspect your layout and see recomposition\ncounts.\n\nIf your UI has poor performance, this is often because of a coding error that\nforces your UI to be recomposed excessively. On the other hand, some coding\nerrors can prevent your UI from being recomposed when it needs to be, which\nmeans UI changes aren't showing up on the screen. Tracking recompositions can\nhelp find both of these kinds of problems.\n\nRecomposition in itself is not bad; however, unexpected recomposition can be an\nissue.\n\nFor more information, see the Layout Inspector [recomposition counts](/develop/ui/compose/tooling/debug#recomposition-counts)\ndocumentation.\n\nComposition tracing\n-------------------\n\nUse [composition tracing](/develop/ui/compose/tooling/tracing) to trace your composable functions in a system\ntrace. Traces are often the best source of information when first looking into a\nperformance issue. They allow you to form a hypothesis of what the issue is and\nwhere to start looking.\n\nAdditional Resources\n--------------------\n\n- **[App performance guide](/topic/performance/overview)**: Discover best practices, libraries, and tools to improve performance on Android.\n- **[Inspect Performance](/topic/performance/inspecting-overview):** Inspect app performance.\n- **[Benchmarking](/topic/performance/benchmarking/benchmarking-overview):** Benchmark app performance.\n- **[App startup](/topic/performance/appstartup/analysis-optimization):** Optimize app startup.\n- **[Baseline profiles](/baseline-profiles):** Understand baseline profiles."]]