Update Terbaru Facebook for Android Lebih Laju Dan Stabil

Sebelum ini, rata-rata pengguna tidak menyukai aplikasi facebook yang amat bermasalah dari pelbagai segi walaupun ianya kerap menerima kemaskini.Antara masalah yang sering dihadapi ialah aplikasi amat berat,lembap dan sering terputus “connection” walhal internet laju dan tidak bermasalah.

faster facebook

Selepas kutukan demi kutukan diterima oleh pihak pembangun Facebook, mereka akhirnya mengeluarkan kemaskini terbaru yang menjadikannya lebih stabil, lebih laju dan membawa beberapa fungsi lain terutama di bahagian foto.

Ternyata, update pada kali ini, membuatkan pengguna gembira dan kebanyakkan daripada mereka memberikan reaksi posiftif dan memujinya.Dibawah ni merupakan antara perubahan besar yang dilakukan pada aplikasi Facebook tersebut dipetik daripada Facebook Engineers :

Performance Challenges 

a) Reducing Garbage Collection: Memory efficiency has a dramatic effect on UI smoothness. Inefficient memory usage will result in many garbage collection (GC) events, which in turn can pause the application for multiple frames and cause a visible stutter during scrolling. We focused specifically on minimizing, eliminating, or deferring allocations in performance-critical code. We also deferred performing allocation-heavy code (like feed story parsing) until scrolling stopped and moved them off the UI thread.

b) Writing a Custom Event Bus: An event bus allows for a publish/subscribe flow, which allows communication between classes that should not be aware of, or dependent on, each other’s existence. Common event bus implementations use object iterators and reflection,  which cause long operations and a lot of memory allocations. To solve this, we implemented a light-weight event bus that avoids all reflection and object iterators so it can be registered and unregistered during performance-critical areas of code like scrolling.

c) Moving Photos to the Native Heap: Loading photos is memory-intensive, and efficiently loading and handling bitmaps can be challenging. The standard method of allocating them directly on the Java heap can result in significant GCs and out-of-memory errors. We moved our bitmaps to be loaded on the native heap using the inPurgeable flag in the BitmapFactory class.  This allowed photos to be allocated in native memory instead of the Java heap (Honeycomb and up) or in external memory tracked by the VM (Froyo/Gingerbread), which in turn significantly reduced their impact on our allocations and thus performance.

d) Writing a Custom ListView Recycler: View recycling speeds up scrolling performance. The stock Android ListView has view recycling support, but it is not efficient for list elements of very different row heights, such as in news feed stories. We wrote a custom view recycler, which detached heavy content views once they were added to the recycling heap.  We also recycled substories in more complicated aggregated feed stories.

Aku sendiri tidak menggemari apps tersebut akan tetapi kemaskini terbaru ini merupakan satu perkembangan terbaik dimana pengalaman menggunakan facebook di android smartphone lebih lancar daripada sebelumnya.Jangan lupa sertai facebook page soleheendotcom untuk mengetahui lebih banyak maklumat tips dan tutorial dunia android ataupun bertanyakan soalan kepada krew kami jika anda menghadapi sebarang masalah.

LEAVE A REPLY

Please enter your comment!
Please enter your name here