React-native: ReactNative 0.55.3 -> 0.61.4 : much more slower on android release builds

Created on 5 Feb 2020  路  4Comments  路  Source: facebook/react-native

Description:

My app works perfectly in debug mode, but lags everywhere in release mode (transitions, touches, loading, etc.).

I made a new project and then transferred my previous code.
It works very well in debug mode, but unfortunately when I turn off debug mode or take the final output, performance drops sharply and the app speed slows down.

React Native version:

System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Memory: 6.12 GB / 11.90 GB
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  SDKs:
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.1, 28.0.2, 28.0.3
      System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: Version  3.5.0.0 AI-191.8026.42.35.5900203
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.4 => 0.61.4

and my app package.json

{
  "name": "...",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@eva-design/eva": "^1.3.1",
    "@ptomasroos/react-native-multi-slider": "^1.0.0",
    "@react-native-community/async-storage": "^1.6.3",
    "@react-native-community/checkbox": "^0.2.2",
    "@react-native-community/netinfo": "^4.6.1",
    "@react-native-firebase/analytics": "^6.0.4",
    "@react-native-firebase/app": "^6.0.3",
    "@react-navigation/core": "^3.5.1",
    "@react-navigation/drawer": "^5.0.0-alpha.23",
    "@ui-kitten/components": "^4.3.2",
    "@ui-kitten/eva-icons": "^4.3.2",
    "lodash": "^4.17.15",
    "pushe-react-native": "^1.0.1",
    "react": "16.9.0",
    "react-native": "0.61.4",
    "react-native-check-box": "^2.1.7",
    "react-native-collapsible": "^1.5.1",
    "react-native-deep-link": "^0.2.9",
    "react-native-gesture-handler": "^1.5.0",
    "react-native-google-places-autocomplete": "^1.3.9",
    "react-native-map-clustering": "^3.1.2",
    "react-native-maps": "0.26.1",
    "react-native-masked-text": "^1.13.0",
    "react-native-modal-picker": "0.0.16",
    "react-native-reanimated": "^1.4.0",
    "react-native-screens": "^2.0.0-alpha.8",
    "react-native-simple-radio-button": "^2.7.4",
    "react-native-svg": "^9.13.6",
    "react-native-webview": "^8.0.3",
    "react-navigation": "^4.0.10",
    "react-navigation-drawer": "^2.3.3",
    "react-navigation-stack": "^1.10.3",
    "react-redux": "^7.1.3",
    "redux": "^4.0.4",
    "redux-thunk": "^2.3.0",
    "rn-sliding-up-panel": "^1.2.1",
    "victory-native": "^33.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.7.2",
    "@babel/runtime": "^7.7.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^5.16.0",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.57.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Expected Results

The final release will work exactly like the debug mode

Needs Upgrade Issue

Most helpful comment

@ProMasoud
I disabled Hermes and re-tested it had the same problem again

All 4 comments

I think it's because of Hermes feature that added in 0.60. it's reduce size of app and increase build time. Hermes build JS code to bitcode and it takes time.

@ProMasoud
I disabled Hermes and re-tested it had the same problem again

Has anyone found a solution for this or at least what's causing it? I'm experiencing it too after upgrading from 0.59.10 -> 0.61.5. Can confirm that Hermes is not the issue.

Edit: FYI my issue is only with the app's boot time. Literally increased from less than a second to a solid 4-5, which is kinda ridiculous. In DEBUG mode the boot time is around 0.5s. No issue with in app screen transition lags or any of the sort, just the boot time.

Do you need help upgrading to a newer React Native version? Visit the Upgrade Support repository or use the upgrade helper to see the changes that need to be made to upgrade your app.

Was this page helpful?
0 / 5 - 0 ratings