React native for android run very slow when not enable “Debug JS”

后端 未结 5 1524
南旧
南旧 2021-02-05 03:33

I am developing an app using react native, I use some code base for ios and android, the ios version run smoothly.

But the android version run very slowly. the weird thi

5条回答
  •  离开以前
    2021-02-05 03:56

    The reason for different execution speeds of javascript code when running in debug mode and without is that when you are in debug mode, in order to enable the debugging experience React Native executes the code in the Chrome browser on your computer, and the results of the execution are bridged onto the device.

    Outside of the debug mode, the code is executed in the JavaScriptCore engine on the device itself.

    That said, I cannot explain why the execution is so slow on the device. Are you perhaps running on an low-powered device, or an emulator with limited allocated memory?

提交回复
热议问题