synonymdev / bitkit

Self-custodial Bitcoin and Lightning Wallet for Android and iOS.
https://bitkit.to
MIT License
109 stars 22 forks source link

Android startup time is slow #2014

Open ovitrif opened 1 week ago

ovitrif commented 1 week ago

This task is to coordinate the work to improve the startup time on Android, ie. opening the app when it's not in background.

In my case, with Pixel 7 Pro it's a random time that always exceeds 5 sec, and there are times when it hangs for as long as ± 16 sec.

Refs

See ….slack.com/archives/C01H106JRQB/p1718628911888799

ovitrif commented 1 week ago

Tested whether our fork of react-native-keychain might have slowed down the startup time and concluded it didn't in any significant way, with only 1-2 seconds diff in startup speed comparing the original library on the latest version with our fork.

ovitrif commented 1 week ago

I watched the adb logs in Android Studio when building & running the debug app from it, there is literally a lot of time (4-10s) between the first log entry mentioning "loading native bindings" and the last one, all different libs with their different bindings. This led me to investigate common knowledge on the speed of loading native bindings in the JVM, an investigation which concludes that most of the performance hit might be rooted in this: