I'm currently down the path of trying to figure out how to decrease Android startup time. It hasn't been an issue with iOS but for Android, I'm seeing anywhere from 6-10 seconds. The goal is to be around 3-4 seconds.
Here's a summary of the research I've come across
- createReactContext: where the react bridge gets initialized and starts loading all the native modules
- getMethodDescriptors: using reflection it compiles (run-time) a list of all exposed methods using
ReactMethod
Solutions exist but not perfect:
- LazyReactPackage (Experimental) https://github.com/facebook/react-native/commit/797ca6c219b2a44f88f10c61d91e8cc21e2f306e
- Removing reflection for all exposed
ReactMethods
https://github.com/facebook/react-native/pull/10084
My problem with these solutions is around using annotation processing to generate classes (compile time). I'm trying to figure out how to get these solutions running with no luck.
Also, other suggestions around decreasing startup time for Android would be helpful.
Thanks!