减少 ANR 后,OkCredit 的平均商家交易量增加了 30%
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
OkCredit 是一款信贷帐号管理应用,为印度的数百万店主及其客户提供服务。凭借月环比 1.4 亿笔交易和超过 5,000 万次下载,OkCredit 公司仅去年一年就记录了价值 500 亿美元的应用交易。
考虑到 OkCredit 的运营规模,以及依赖其应用管理帐号的数百万家企业,我们必须确保所有用户无论使用什么设备,都能获得流畅、顺畅的体验。
用户会以正面评价和高评分奖励表现最好的应用。如果应用存在稳定性或性能问题,往往会让用户感到失望,甚至会遇到糟糕的评分。这使得 ANR(应用无响应)成为一个重要的性能指标,需要跟踪用户能否持续提供良好的用户体验。
OkCredit 对改进 Android Vitals 的投入,例如减少 ANR 和缩短应用启动时间,因此获得了回报,尤其是在低端设备(资源本来就已经很有限)上。他们发现客户留存率有所提高,应用上的商家交易量也有所改善。
面临的挑战
OkCredit 的一个主要细分是低端设备用户。这类设备资源有限,在这类设备上执行繁重任务很容易导致用户体验欠佳。例如,一个主要的维护挑战是跟踪和添加针对 ANR 的检测。我们的目标是解决这些问题,从而改善整体用户体验并增加商家交易量。
他们做了什么?
对于 OkCredit 这类应用,减少 ANR 并缩短应用启动时间,不仅能让客户满意,还能增加应用中的商家交易量。
调试 ANR 时,最重要的线索是找出发生 ANR 时主线程在做什么。根据 Google 的反馈,OkCredit 制定了一种结构化方法来识别此类 ANR。
- 使用 Android Vitals 监控性能,并使用 Firebase Crashlytics 的自定义报告来了解 ANR 问题
- 通过将第三方库移至后台线程,优化了从应用启动时对第三方库的初始化
- 使用 Systrace 和 Profiler 等工具来识别广播接收器和服务中的 ANR。基于 CI 的 Macrobenchmark 还帮助对冷启动进行了基准测试。
- 使用方法分析器,可将对象识别为延迟加载。
- 使用 Perfetto 确定了高膨胀布局。
- 通过在后台线程中将所有 apply() 更改为 commit(),解决了共享偏好设置中的 ANR 问题。
通过比较指标或使用 systrace、CPU 性能分析器等工具,对上述任务进行了验证,以确认其影响。
成果
除了改进指标和用户体验之外,OkCredit 开发团队还获得了相关数据洞见,帮助他们今后改进开发流程。
- 在低端设备上 -
- ANR 降低了 60%
- 低端设备第一天的客户留存率提高了约 22%
- 每个商家的平均交易量增加了 30%
- 应用在 Play 商店中的评分从 4.3 提高到 4.6
- 冷启动时间缩短了约 70%
- 在任何屏幕上从第一帧开始完整绘制时,用户点击的次数增加了 60%
这项练习将团队聚集在一起,共同制定最佳实践,并鼓励他们专注于改善用户体验。该团队已开始在开发过程中使用 Perfetto 和 CPU 性能分析器等工具,以增进他们对该系统的了解并更快地做出决策。
“专注于减少 ANR 有助于我们提供愉悦的体验,让自己脱颖而出。这提高了留存率并减少了用户流失。
此外,由于团队的卓越工程,诸如此类的做法对组织的文化有着深远的影响。这让我们作为团队和公司在印度新兴的 SMB 数字化行业中设定了新的应用性能基准,这让我们感到非常自豪。”
- Gaurav Kunwar(联合创始人兼 CPO - OkCredit)
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-04-13。
[null,null,["最后更新时间 (UTC):2022-04-13。"],[],[],null,["# OkCredit’s average merchant transaction goes up by 30% after reducing ANR\n\nOkCredit is a credit account management app for millions of shop owners and their customers in India. With 140M transactions month over month, and 50M+ downloads, last year alone saw OkCredit recording $50 billion worth of transactions on the app.\n\nConsidering the scale that OkCredit operated in, and the millions of businesses that depend on its app for managing their accounts, it is imperative that OkCredit ensures a smooth and seamless experience for all its users, irrespective of the device they are using.\n\nUsers reward the best performing apps with positive reviews and high ratings. An app that has stability or performance issues often leads to frustration and even worse, bad ratings. This makes ANRs (Application Not Responding) an important performance metric to track if you're aiming to delight your users and give them a consistently good user experience.\n\nOkCredit's investments in improving Android Vitals, like reducing ANR and improving app startup time led them to reap dividends, especially on low-end devices (which are already resource limited). They saw both improvements in customer retention as well as merchant transactions on the app.\n\nThe Challenge\n-------------\n\nOne of the key segments for OkCredit were users on low-end devices. These devices are resource limited and running taxing tasks on them can easily create a sub-optimal user experience. For example, a major maintenance challenge was tracking and adding instrumentation for ANRs. The goal was to address these issues with the aim of improving the overall user experience and increasing merchant transactions.\n\nWhat did they do?\n-----------------\n\nReducing ANR and improving app startup times for an app like OkCredit meant happy customers and moreover an increase in merchant transactions on the app.\n\nThe most important clue in debugging an ANR is finding out what the main thread was doing when the ANR happened. Working with feedback from Google, OkCredit created a structured approach for identifying these ANRs.\n\n- Monitored performance using Android Vitals and used custom reporting on Firebase Crashlytics to learn about ANRs\n- Optimized initialization of third party libraries from App start, by moving these to a background thread\n- Used tools like Systrace and Profiler to identify ANRs in broadcast receivers and Services. Macrobenchmark on CI also helped benchmark cold startups.\n- Using method profiler, objects were identified to be loaded lazily.\n- Using perfetto, high inflation layouts were identified.\n- ANR in shared preferences were solved by changing all apply() to commit() in a background thread.\n\nThe above tasks were validated to confirm their impact by comparing metrics or using tools such as systrace, CPU profiler etc.\n\nThe Results\n-----------\n\nBeyond improving metrics and the user experience, the OkCredit development team gained insights that helped them improve their development process going forward. \n\n- On low-end devices -\n - Reduced ANR by 60%\n - Improved Day 1 customer retention of low-end devices by about 22%\n - The average transaction for each merchant increased by 30%\n- Improved app rating from 4.3 to 4.6 on the Play Store\n- Cold startup time improved by \\~70%\n- Saw 60 % improvement in user click to full draw of first frame on any screen\n\nThis exercise has brought the team together to create best practices and encouraged them to focus on improving the user experience. The team has started using tools like Perfetto and CPU profiler during development itself in order to improve their understanding of the system and make decisions faster.\n\u003e \"Focusing on reducing ANRs has helped us differentiate ourselves by offering a\n\u003e delightful experience. This has led to increased retention, and reduced churn.\n\u003e Additionally, due to the teams' engineering excellence, practices such as\n\u003e these have a profound influence on organization's culture. This makes us proud\n\u003e as a team, and company setting new benchmarks of app performance in the\n\u003e nascent Indian SMB digitisation industry.\"\n\u003e\n\u003e **-- Gaurav Kunwar (Cofounder \\& CPO - OkCredit)**"]]