Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: trade apk size to speed up launch time #22156

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

siddarthkay
Copy link
Contributor

Summary

This PR un compresses the android bundle which apparently improves Time to Interactivity by 400ms.
There is a slight tradeoff in bundle size and I want to measure that.

This technique was first discovered and accepted by RN team here : facebook/react-native#49449

Platforms

  • Android

status: ready

@siddarthkay siddarthkay self-assigned this Feb 18, 2025
@siddarthkay siddarthkay requested a review from a team February 18, 2025 18:14
@status-im-auto
Copy link
Member

status-im-auto commented Feb 18, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 531f1ce #1 2025-02-18 18:19:42 ~4 min tests 📄log
531f1ce #1 2025-02-18 18:23:39 ~8 min android-e2e 📄log
✔️ 531f1ce #1 2025-02-18 18:24:29 ~9 min android 🤖apk 📲
✔️ 531f1ce #1 2025-02-18 18:25:35 ~10 min ios 📱ipa 📲
✔️ 19d202b #2 2025-02-25 15:51:46 ~5 min tests 📄log
19d202b #2 2025-02-25 15:55:19 ~8 min android-e2e 📄log
19d202b #2 2025-02-25 15:55:41 ~9 min android 📄log
✔️ 19d202b #2 2025-02-25 15:57:23 ~10 min ios 📱ipa 📲

@ulisesmac
Copy link
Contributor

Hey @siddarthkay !

Thaks for this PR, I'm wondering, what was the previous bundle size and what is the new one?

@siddarthkay
Copy link
Contributor Author

siddarthkay commented Feb 18, 2025

There is an APK size increase of 11.7 MB

Screenshot 2025-02-19 at 12 10 38 AM

@ilmotta
Copy link
Contributor

ilmotta commented Feb 18, 2025

Nice finding @siddarthkay! The 400ms improvement can vary a lot per app it seems. This number comes from the Discord app from the linked RN PR right? If so, before merging this PR I think it's important we show evidence of sufficient improvement to justify the increase in bundle size. Let's say in 2-3 Android devices sufficiently different and averaging the test runs.

For this, it seems that a QA won't be able to test this PR because we need precise measurements.

Verified

This commit was signed with the committer’s verified signature.
siddarthkay Siddarth Kumar
@siddarthkay siddarthkay force-pushed the trade-apk-size-for-startup-speed branch from 531f1ce to 19d202b Compare February 25, 2025 15:46
@churik
Copy link
Member

churik commented Mar 10, 2025

@siddarthkay @ilmotta If there are any insights on how to measure this parameter, I can allocate resources to help.

I tried checking it via Profiler in Android Studio but couldn’t find any relevant data—most likely, it needs to be built locally (or maybe I just don’t know where to look).

@siddarthkay
Copy link
Contributor Author

@churik : the measurement was done using react-native-performance I can find you some notes on how to do so.
I had played with this tool a while ago.

@ilmotta : yes it was done on Expensify app too along with Discord.
I too will run some benchmarks locally.
They key metric this approach improves is TTI ( Time To Interactivity ) at the cost of increase in APK size due to an uncompressed bundle.

@ilmotta
Copy link
Contributor

ilmotta commented Mar 11, 2025

@ilmotta : yes it was done on Expensify app too along with Discord. I too will run some benchmarks locally. They key metric this approach improves is TTI ( Time To Interactivity ) at the cost of increase in APK size due to an uncompressed bundle.

Hoping for the best in your benchmarks @siddarthkay 🙏🏼 To judge the tradeoff is worth it we will need a statistically significant result. I volunteer to help if you can provide the steps, as it would be quite important to verify in a diverse set of devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: CONTRIBUTOR
Development

Successfully merging this pull request may close these issues.

None yet

7 participants