In today’s digital era, users expect apps to be responsive and fast loading. Android 11 comes with a new feature, IORap, which significantly boosts application startup performance. On average, applications start more than 5% faster, also referred to as a cold startup, across multiple devices. However, some applications show more than 20% faster startup times. Users get this bonus performance without any developer app changes.
As a leading Android development company, we have been offering native android development services to our global clientele over the years. We have a team of the most seasoned Android app developers who have already build Android apps for clients of different verticals. We understand that an app with a slow startup time can be very annoying and may disappoint users, therefore, keeping this in mind our app developers optimize the app’s launch time by addressing the associated startup issues.
Let us now dig deeper into the topic as to how I/O prefetching can improve app startup times.
IORap Prefetching for Android Apps
IORap significantly reduces app startup times by predicting which I/O will be required and doing it in advance. Many app startups take a lot of time that the IO request queue isn’t being saturated because of blocking I/O. This doesn’t maximize IO latency. After prefetching the data and compacting the I/O, the app can access this data from the pagecache in no time, thereby reducing app startup latency.
If you need to properly diagnose app startup time performance, you can hire android app developers from us and they will track metrics that indicate how long it takes your application to start and optimize it for optimal startup performance.
How Does IORap Work?
IORap works as an independent service on the device. It effectively communicates with the package manager, activity manager, perfetto service, and more via IPC.
The complete architecture of IORap is shown in the following figure:
Step 1: Collecting perfetto traces
IORap employs a profiling-based strategy to determine the number of I/O to be prefetched. This knowledge is gained from perfetto trace that records the kernel pagecache page additions or removals from ftrace. In the initial cold-runs of an app, the perfetto tracing is on to get the pagecache missing events. The overhead of perfetto tracing on app startup time is neglectable.
Step 2: Generating an I/O prefetch list
After the first step, IORap generates a prefetch list based on the perfetto traces during the idle time of the device. This prefetch list contains the information of the file such as name, length, offset that was accessed by an app when it’s launched. IORap evaluates the mm_pagemap events from the perfetto trace and translates its results, (that is inode, offset, length), to (name, offset, length) by reversing inode to a filename. This data is then stored in the prefetch list in a file named protobuf.
Step 3: I/O prefetching
Once the prefetch list is generated, IORap then prefetches the corresponding data for the following runs of the app. During this phase, the perfetto tracing is not required anymore and the user and developer needn’t do anything. The prefetching is done when the user taps on the app icon or indirectly through another app requesting it via Intent. Now you can enjoy the speedup.
Step 4: Obsoleting the prefetch list
The prefetch list doesn’t last forever as many events may cause the prefetch list to become obsolete. When an app gets updated, the prefetch list becomes outdated because the app may change and the previous data may be inaccurate. Additionally, the dexopt service can optimize the app after the installation. After the app is optimized, the layout may differ which makes the prefetch list obsolete. Therefore, this list will be removed and a new round will start with collecting perfetto trace.
Observations
It is observed that IORap benefits a wide spectrum of devices ranging from low-end to high-end devices. On average, IORap could speed up start-up times by ~26%. It is extremely helpful for applications that have heavy I/O during their startups. It has been also observed that the performance of IORap is greatly impacted by the amount of prefetched data. Also, an accurate trace duration is very important for IORap. A shorter trace duration results in less data than required to be prefetched and less performance gain. Conversely, a longer trace duration causes more data than required to be prefetched, which results in a slower startup in the worst conditions. IORap uses the timestamp of when an application reports the ReportFullyDrawn event to calculate the trace duration. For apps that are not reporting this event, the display time is used. Therefore, invoking the reportFullyDrawn callback at the appropriate time can enhance the performance of IORap.
As we specialize in native android development services, our app developers build the most robust, highly-effective, and light-weight Android apps that launch in a matter of seconds.
Conclusion
You can assist IORap by invoking ReportFullyDrawn callback when an app completes its startup. IORap primarily helps in reducing the I/O blocking time, so make sure you profile the app startup for other potential performance issues.
Being a top-notch Android app development company, we take great care in developing an app that comes with super-fast performance and takes negligible time to launch as soon as a user taps the icon.
All you need to do is hire Android app developers from us that have vast experience and expertise in proffering the best-in-class native Android app development services.
FAQs
Q.1. How many types of application do you develop?
Ans. As a professional Android app development company, we build apps for clients across all business verticals including utilities, fun & entertainment, travel, finance, e-learning, real estate, healthcare, social networking, productivity, weather, business, gaming and children’s apps, many more.
Q.2. Do you also include app maintenance in your native Android development services?
Ans. Being a full-cycle native Android app development company, we have your back at every stage of development, right from conceptualization to after-sale support and maintenance. So, for any issues that you face with your Android app, just hire Android app developers from us and they will take care of the rest.
Q.3. How much does it cost to build an Android app?
Ans. The development cost will depend on its complexity and your project requirements. Other factors contributing to the cost include the graphics and animations used, sound effects, designs, integrations, and features, the experience level of the developers, and so on. To know about the estimated cost of the project, kindly send us your project requirements and we will get back to you shortly.