GithubHelp home page GithubHelp logo

Comments (32)

mhorowitz avatar mhorowitz commented on April 27, 2024 9

Without more information on the environment you are running in, it's hard to say for certain. I would be interested in hearing about what android environment you are using, and what the actual measured times are. That said, I have a few general observations.

When you use Remote JS Debugging, the JavaScript does not run on your phone or simulator. It actually runs on Chrome running on your development machine (laptop or deskop). Your dev machine is likely many faster than a phone. Running in a simulator will likely perform better than a real device, but it still will not be as fast as a local non-simulated environment.

When you use Hermes in a production build, the bytecode is compiled in advance and can be executed quickly. When you use Hermes locally with Metro, Hermes is running in a lazy compilation mode. This is faster than compiling all the bytecode every time you reload from Metro, but slower than a production build. So slowness in dev mode does not necessarily means slowness in release mode. If Metro were able to compile bytecode one module at a time and deliver it incrementally to the device, this would probably help, but we don't have a plan to do this on our roadmap right now. This would be a great project for someone who wanted to help make Hermes work better in development environments.

from hermes.

carlosroberto555 avatar carlosroberto555 commented on April 27, 2024 8

@mhorowitz this is a good explanation.
Makes all sense run faster when js code is runing on browser. It's faster like a fully native platform experience.
I did not tested production build yet, because I didn't had time, but I try tomorrow.
The results is with Hermes on, and I think with Hermes off more faster on config 1 and 2.

Configuration 1 (very slow)

JS Dev Mode: true
JS minify: false
Remote JS Debugging: false

Configuration 2 (slow)

JS Dev Mode: false
JS minify: true
Remote JS Debugging: false

Configuration 3 (inacreditable fast)

JS Dev Mode: true
JS minify: false
Remote JS Debugging: true

Configuration 4 (I think fast like config 3)

JS Dev Mode: false
JS minify: true
Remote JS Debugging: true

My device info:

Device: Moto G3
Processor: 1.4 GHz Quad Core
Android: 6.0
RAM: 1GB

More details on this technical page

from hermes.

sontb avatar sontb commented on April 27, 2024 7

same here

from hermes.

AlithAnar avatar AlithAnar commented on April 27, 2024 4

confirmed

from hermes.

Inovassist-dev avatar Inovassist-dev commented on April 27, 2024 4

Yeah guys, same here...
Any idea of what can be happening?

from hermes.

WoodyWoodsta avatar WoodyWoodsta commented on April 27, 2024 4

I stand to be corrected, but when the remote debugger is connected, the app does not use the target device's JS engine, but rather the debugger's. So when connected to the React Native Debugger, the JS engine is not Hermes (unless I have categorically misunderstood how RN works!). This would explain the speedup when connected to the debugger.

from hermes.

Ashkan-Oliaie avatar Ashkan-Oliaie commented on April 27, 2024 3

thanks so much for this issue :D , I've been crying all day trying to uninstall and install modules and debugging :D till I found out about Hermes low performance

from hermes.

mhorowitz avatar mhorowitz commented on April 27, 2024 3

@WoodyWoodsta @RichardLindhout
If you use "Remote JS Debugging" you are getting a JS engine (v8) in Chrome. If you use Chrome's chrome://inspect mechanism to attach to Hermes, then you get Hermes. It is expected that the former will be faster than the latter. Your laptop is usually faster than your phone.

from hermes.

mhorowitz avatar mhorowitz commented on April 27, 2024 2

@carlosroberto555 thanks for the additional detail. It's not surprising that Chrome running on your laptop is faster than Hermes running on a device first introduced four years ago. I would expect JS in Chrome on your laptop to be faster than any JS engine on this phone. Have you tried this with Remote JS Debugging disabled and Hermes disabled?

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024 2

Wow definitely a lot faster, fastest version of my app I have ever seen!

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024 2

I disabled hermes for now since the debug mode without remote debugging is too slow right know. Should not be a problem most of the time but the application I work on has some GPS features which I need to test outside. So connection breaks with the remote debugger ;)

from hermes.

carlosroberto555 avatar carlosroberto555 commented on April 27, 2024 2

We are waiting for enhancement that @tmikov says above with debug performance improves.
If have to make continuous tests on app is more easy disable hermes until finish then.
Sorry if I talk confuse, I'm learning english yet haha

from hermes.

tmikov avatar tmikov commented on April 27, 2024 1

When #73 is done, it might improve things.

from hermes.

carlosroberto555 avatar carlosroberto555 commented on April 27, 2024 1

@RichardLindhout I am working in another priorized project, but on this weekend I will try it

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024 1

I'm trying it out a.t.m.

from hermes.

JManuelMT-zz avatar JManuelMT-zz commented on April 27, 2024 1

this is also happening to me in iPhone

from hermes.

tapz avatar tapz commented on April 27, 2024 1

I just switched to a new development phone Samsung Galaxy A51 5G. My app runs EXTREMELY slowly under Hermes when using a debug version. It's almost impossible to use the app as the ui works so slowly. I have no idea what the debug mode causes Hermes to do under the hood as I'm not using a debugger and all I need in the debug mode is a proper stack trace. Maybe I just need to start developing in release mode as the debug mode in Hermes is totally useless.

from hermes.

mhorowitz avatar mhorowitz commented on April 27, 2024

Can you describe your environment in more detail? In particular, are you running your app in a simulator (what kind?) or on device (what kind?)?

from hermes.

ca-beller avatar ca-beller commented on April 27, 2024

Yeah I'm having the same issue as well.

from hermes.

carlosroberto555 avatar carlosroberto555 commented on April 27, 2024

Not yet, I'll try it tomorow too

from hermes.

carlosroberto555 avatar carlosroberto555 commented on April 27, 2024

I don't had time on last week for test, but I got theese configurations without hermes:

Configuration 5 without hermes (faster than config 1 and 2)

JS Dev Mode: true
JS minify: false
Remote JS Debugging: false

Configuration 6 without hermes (I think fast like config 3 and 4)

JS Dev Mode: false
JS minify: true
Remote JS Debugging: false

Without hermes I had performance improvement Remote JS Debugging disabled.
When I have time for test, I'll compare with --variant=release for get more results.

from hermes.

carlosroberto555 avatar carlosroberto555 commented on April 27, 2024

I've upgraded to from 0.60.3 to 0.60.4 and now configuration 2 seems a bit more fast

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024

For me it's slower too on debug, any result @carlosroberto555 from variant release?

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024

@WoodyWoodsta That is correct for the old JSC, but with Hermes it's also Hermes in Chrome I think.

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024

You're maybe right. I think I misunderstood some debugging things here: https://engineering.fb.com/android/hermes/

from hermes.

WoodyWoodsta avatar WoodyWoodsta commented on April 27, 2024

So if we use something like https://github.com/jhen0409/react-native-debugger, we're getting v8 as opposed to Hermes? (My guess is yes, since I've come across some actual differing behaviour between debugging/not-debugging in the past)

from hermes.

mhorowitz avatar mhorowitz commented on April 27, 2024

I'm not familiar with that particular tool, but based on the documentation, I believe you are correct.

from hermes.

RichardLindhout avatar RichardLindhout commented on April 27, 2024

If you turn off JS Dev Mode the performance is acceptable without disabling Hermes or using the remote debugging.

from hermes.

JManuelMT-zz avatar JManuelMT-zz commented on April 27, 2024

Hey guys in my case the createLogger and composeWithDevTools was the problem, It seems is saturating the memory (in debug mode there is no problem because you are using JS engine (v8) in Chrome as @mhorowitz said), remove that for prod

from hermes.

vitto-moz avatar vitto-moz commented on April 27, 2024

maybe the reason is that in case of using "Remote Debugging" you have Chrome V8 as a javascript engine

from hermes.

jjhampton avatar jjhampton commented on April 27, 2024

I've also observed a significant slowdown when running my RN app (on Android or iOS) in development mode, on a device, without the remote debugging turned on.

To add on to @carlosroberto555's comments, when I add --minify=false to my Metro Bundler command, the app seems to run much faster than before.

from hermes.

Huxpro avatar Huxpro commented on April 27, 2024

Close due to staleness. The difference between "Debugging JS on Hermes using Google Chrome's DevTools" vs. "Remote JS Debugging" had been documented on https://reactnative.dev/docs/hermes#debugging-js-on-hermes-using-google-chromes-devtools

Please open a new issue if you have further difficulties regarding debugging with Hermes. Thanks!

from hermes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.