يساعد تطبيق ShareChat في معالجة مشاكل Jank لزيادة مستوى تنقّلهم في الخلاصة بنسبة %60.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
المقدّمة
ShareChat هو منصّة رائدة في الهند لوسائل التواصل الاجتماعي تتيح للمستخدمين مشاركة آرائهم وتوثيق حياتهم واكتساب صداقات جديدة بلغتهم الأم. وتشمل الميزات الأخرى غرف المحادثة والمراسلة الخاصة، ما يتيح للمستخدمين مشاركة الفيديوهات والنكات والأغاني وغير ذلك من المحتوى الاجتماعي المستند إلى اللغة. في إطار سعينا إلى قيادة ثورة الإنترنت في الهند، يعمل تطبيق ShareChat على تغيير طريقة تفاعل المليار مستخدم القادم على الإنترنت.
التطبيق بالأرقام
- أكثر من 100 مليون عملية تنزيل
- أكثر من 180 مليون مستخدم نشط شهريًا
- أكثر من 32 مليون منشئ محتوى
- 15 لغة هندية مختلفة
- يتم إنشاء 1.5 مليون مشاركة تقريبًا يوميًا.
التحدّي
مع تزايد عدد المستخدمين الذين حصلوا على تطبيق ShareChat يوميًا، واجه التطبيق تحديًا في تقديم إطارات جديدة باستمرار، ما أدّى إلى أوقات استجابة سيئة أعاقت تجربة المستخدم.
نتيجةً لذلك، شهد التطبيق عددًا متزايدًا من اللقطات المتأخرة أو المتأخرة (المعروفة أيضًا باسم "Jank"). وقد كان إصلاح مشاكل الأداء هذه من خلال تحسين اللقطات البطيئة والجامدة أمرًا بالغ الأهمية في تقديم تجربة سلسة لجميع المستخدمين. وسيؤدّي ذلك أيضًا دورًا مهمًا في تشجيع المستخدمين على قضاء المزيد من الوقت على التطبيق وزيادة تفاعلهم، وبالتالي تحسين تقييم ShareChat على "متجر Play" لنظام التشغيل Android.
كيفية التنفيذ
تعاون فريق ShareChat مع فريق علاقات المطوّرين في Google للحدّ من تأثير المشاكل في النشاط التجاري من خلال تحسين الإطارات البطيئة والمجمّدة (Jank) في التطبيق. وعلى وجه التحديد، عمل الفريق على تحسين المشاكل التالية:
مجموعة RecyclerView المشتركة - من خلال التحليل، لوحظ أن إنشاء أشخاص طرق عرض مختلفين يستغرقون وقتًا أطول، ولتقليل ذلك، تم إنشاء مجموعة مشتركة لـ RecyclerView. وساعد ذلك أيضًا في إزالة تكلفة إنشاء أصحاب المشاهدات للخلاصات المشابهة.
بطاقة تصميم مفرطة: من خلال تحديد الملفات الشخصية، لوحظ أيضًا أنّ بعض مالكي الملفات الشخصية كانوا يطلبون تنسيقات requestLayouts إضافية. لتحسين الأداء، تم تحديث الرمز لاستخلاص قيمة في وقت الإنشاء بدلاً من كل عملية ربط، وبالتالي توفير تكاليف requestLayout الإضافية.
OverDraw - تم تبسيط التنسيقات لتقليل الطبقات وإزالة الألوان التي تم ضبطها بشكل منفصل لكل طبقة من الطبقات.
تسوية التسلسل الهرمي - تمت ملاحظة التضخم الطويل من خلال التوصيف والفحص اليدوي للعديد من الشاشات. تم تسوية العرض الهرمي باستخدام ConstraintLayout لحل هذه المشكلة.
تضخُّم مفرط في المشاهدات: يتم تحديد مدّة التضخم الطويلة لمشاهدات معيّنة أثناء إنشاء ملفات تعريف خاصة بها. تم تحويل هذه المشاهدات إلى مشاهدات.
إزالة المهام الثقيلة من سلسلة محادثات واجهة المستخدم: سمح استخدام محلّل بملاحظة بعض الأماكن التي كان يتم فيها تنفيذ مهام صعبة في سلسلة التعليمات الرئيسية، مثل إنشاء SpannableStringBuilder عليها وضع علامات وتصميم لكل ربط recyclerView، وفك ترميز Bluetooth Hash، وما إلى ذلك. وقد تمت إزالة هذه المهام من سلسلة واجهة المستخدم ونقلها إلى سلسلة محادثات في الخلفية.
نقل البيانات من Rx إلى Coroutine: أدّى استهلاك الذاكرة أيضًا إلى تكرار طلب تجميع البيانات المهملة وارتفاع عدد سلاسل التعليمات في أكثر من 100 RX. تم نقل العديد من حالات الاستخدام إلى Coroutine لإصلاح هذه المشاكل.
استخدام Coil لتحميل الصور: تسبّبت ميزة "التمرير" في حدوث مشاكل أثناء تحميل الصور، لا سيّما في المكوّنات التي تم إنشاؤها باستخدام الإصدار Jetpack. تبيّن لنا أيضًا أنّه أثناء تحميل الصور في LazyColumn، كان شريط حد العرض مرتفعًا. وقد أدت هذه الحالات إلى استخدام الملف لتحميل الصور.
تنظيف الرموز القديمة وإعادة هيكلتها: ساعدت إزالة الرموز البرمجية القديمة والتجارب في إزالة العروض المخفية غير الضرورية من واجهة المستخدم وساعدت في إعادة كتابة بعض الشاشات بطريقة أفضل.
النتائج
من خلال تحليل مجالات التحسين وتحديد استراتيجيات التحسين، يمكن لتطبيق ShareChat تحسين التجربة العامة للمستخدمين وزيادة نسبة التفاعل وتقييمات "متجر Play". في ما يلي نظرة عامة كَمية للنتائج التي حققها ShareChat -
- انخفاض بنسبة% 45 تقريبًا في اللقطات "بطيء العرض" على "متجر Play"
- تقليل بنسبة% 30 تقريبًا في إطارات "Frozen" على "متجر Play"
- انخفضت معدّل عرض الإطارات البالغ 10 آلاف لقطة من 10.72% إلى 3.98% لكل 10 آلاف لقطة
- زيادة الانتقال في الخلاصة بنسبة %60
- ارتفع إجمالي التقييمات على المتجر من 4.0 تقريبًا إلى 4.3.
- زيادة بنسبة% 10 في استهلاك المشاركات
"هدفنا في ShareChat هو أن يكون أفضل تطبيق لوسائل التواصل الاجتماعي
يُسعد مستخدمينا، وهذا يعني أيضًا أن نكون الأفضل في ما يتعلّق بأداء التطبيق.
ساعدنا تعاوننا مع فريق علاقات مطوّري البرامج في Google في تحديد
مجالات التحسين على أجهزة المستخدمين منخفضة الجودة الأكثر استخدامًا. وتعلّمنا أفضل الممارسات والأدوات المتعلقة بالأداء لتحديد وإصلاح الإطارات الثابتة وحالات عدم الأداء
وتجاوز الأخطاء وأخطاء ANR".
– فيهان فيرما، مديرة هندسة، فريق Android في ShareChat
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# ShareChat addresses Jank issues to increase feed scrolling by 60%\n\nIntroduction\n------------\n\nShareChat is a leading social media platform in India that allows users to share their opinions, document their lives, and make new friends in their native language. Other features include chatrooms, and private messaging, enabling users to share videos, jokes, songs and other language-based social content. On a mission to spearhead India's internet revolution, ShareChat is changing how the next billion users will interact on the internet.\n\nThe app in numbers\n\n- **100 Million+** downloads\n- **180 Million+** Monthly Active Users\n- **32 Million+** content creators\n- **15** different Indian languages\n- **\\~1.5** Million posts created daily\n\nThe Challenge\n-------------\n\nAs ShareChat grew to be loved by thousands of people daily, the app faced a challenge in consistently delivering new frames leading to poor response times that impeded user experience.\n\nAs a result, the app saw an increased number of dropped or delayed frames (also known as \"Jank\"). Fixing these jank issues by improving slow \\& frozen frames was critical in delivering a seamless experience to all its users. This would also play an important role in making users spend more time on the app, increasing engagement and, in turn, improving ShareChat's rating on the Android Play Store.\n\nHow They Did It\n---------------\n\nShareChat worked with Google's developer relations team to reduce Jank and yield a positive business impact by improving slow \\& frozen frames (Jank) on the app. Specifically they worked on improving the following issues -\n\n- **Shared RecyclerView Pool** - Through profiling, it was observed that creating different viewholders takes longer and to minimize that, a Shared RecyclerView Pool was created. This also helped in removing the viewholders creational cost for similar feeds.\n\n- **Excessive Layout Passesl** - Through [profiling](https://perfetto.dev/), it was also observed that some viewholders were requesting additional requestLayouts. To optimize, the code was updated to take value in creation time instead of every bind, thus saving extra requestLayout costs.\n\n- **[OverDraw](https://developer.android.com/topic/performance/rendering/inspect-gpu-rendering)** - Simplified the layouts to reduce layering and removing colors that were being set separately for each of the layers.\n\n- **Flattening of hierarchy** - Observed long inflation through profiling and manual inspection of many screens. The hierarchy was flattened using [ConstraintLayout](https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout) to solve for this.\n\n- **Excessive View Inflation** - Identified long inflation time for certain views while profiling. These views were converted to viewstubs.\n\n- **Removing heavy tasks from UI thread** - Using a profiler allowed for observation of a couple of places where heavy tasks were being done on the main thread, such as creating SpannableStringBuilder with tagging and styling of every recyclerView bind, BlurHash decoding, etc. These tasks were removed from the UI thread and moved to a background thread.\n\n- **Migrating from Rx to [Coroutine](https://developer.android.com/kotlin/coroutines#:%7E:text=A%20coroutine%20is%20a%20concurrency,established%20concepts%20from%20other%20languages)** - Memory consumption also led to frequent GC calls, and there were very high thread counts via the \\\u003e100 RX thread. Many of the use cases were moved to Coroutine to fix these issues.\n\n- **Adoption of [Coil](https://coil-kt.github.io/coil/) for image loading** - Glide was causing issues while loading images, specifically in the components built via jetpack compose. It was also identified that while loading images in LazyColumn, the rendering threshold bar was high. These occurrences led to the adoption of Coil for image loading.\n\n- **Old code cleanup and refactoring** - Removal of old code and experiments helped to remove unnecessary hidden views from the UI and helped rewrite some of the screens in a better way.\n\nResults\n-------\n\nBy analyzing improvement areas and identifying optimization strategies, ShareChat could improve the overall experience for users while increasing its engagement rate and Play Store ratings. Below is the quantitative overview of the results ShareChat achieved -\n\n- \\~45% reduction in 'Slow rendered' frames on Play Store\n- \\~30% reduction in 'Frozen' frames on Play Store\n- Janky frame rates for every 10K frames rendered reduced from 10.72% to 3.98%\n- Feed-scrolling increased by 60%\n- The overall ratings on the Store increased from \\~4.0 to 4.3\n- 10% increase in consumption of posts\n\n\u003e \"At ShareChat, our goal is to be the best social media app out there that\n\u003e delights our users.This also means being the best in terms of app performance.\n\u003e Our collaboration with Google's developer relations team helped us identify\n\u003e areas of improvement on our most used low-end user devices. We learned the best\n\u003e performance practices and tools to identify and fix frozen frames, janks,\n\u003e overdraws, and ANRs.\"\n\u003e\n\u003e **-- Vihaan Verma, Engineering Manager, Android Team at ShareChat**"]]