Comments (32)
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.
@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.
same here
from hermes.
confirmed
from hermes.
Yeah guys, same here...
Any idea of what can be happening?
from hermes.
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.
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.
@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.
@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.
Wow definitely a lot faster, fastest version of my app I have ever seen!
from hermes.
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.
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.
When #73 is done, it might improve things.
from hermes.
@RichardLindhout I am working in another priorized project, but on this weekend I will try it
from hermes.
I'm trying it out a.t.m.
from hermes.
this is also happening to me in iPhone
from hermes.
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.
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.
Yeah I'm having the same issue as well.
from hermes.
Not yet, I'll try it tomorow too
from hermes.
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.
I've upgraded to from 0.60.3 to 0.60.4 and now configuration 2 seems a bit more fast
from hermes.
For me it's slower too on debug, any result @carlosroberto555 from variant release?
from hermes.
@WoodyWoodsta That is correct for the old JSC, but with Hermes it's also Hermes in Chrome I think.
from hermes.
You're maybe right. I think I misunderstood some debugging things here: https://engineering.fb.com/android/hermes/
from hermes.
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.
I'm not familiar with that particular tool, but based on the documentation, I believe you are correct.
from hermes.
If you turn off JS Dev Mode the performance is acceptable without disabling Hermes or using the remote debugging.
from hermes.
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.
maybe the reason is that in case of using "Remote Debugging" you have Chrome V8 as a javascript engine
from hermes.
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.
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)
- Building Static Hermes on Windows HOT 4
- Problems finding libraries with fresh compile under windows HOT 3
- Conversion of large array to a Set seems slow HOT 3
- React Native & Hermes: Is Additional Code Obfuscation Beneficial? HOT 1
- Array.protoype.indexOf() Performance Regression HOT 3
- 'hermes-engine' uses the unencrypted 'http' protocol to transfer the Pod.
- hermes-eslint missing `__defineGeneric` in context `getScope` HOT 1
- Date constructor accept wrong ISO 8601 date HOT 2
- libc.so (SIGABRT, SIGSEGV) HOT 4
- Performance regression traversing large arrays compared to other engines HOT 4
- Hermes 0.7.2 : Max heap size was exceeded HOT 4
- hermes eslint: No sourceCode in context HOT 6
- Bug: recursion: "Maximum call stack size exceeded" HOT 2
- Wrong `DCMAKE_TOOLCHAIN_FILE` in docs HOT 3
- Intl.NumberFormat can't always display the number's sign HOT 1
- Intl.NumberFormat with compact notation doesn't display formatting HOT 1
- Examples how to use the experimental C ABI? HOT 3
- babel-plugin-syntax-hermes-parser drops chunk names HOT 1
- static_h: Assertion `Val && "isa<> used on a null pointer"' failed with -typed on tsc.js HOT 2
- fatal: unable to access 'http://github.com/facebook/hermes.git/' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermes.