-
Notifications
You must be signed in to change notification settings - Fork 671
Does hermes make some specific optimized for React.js or related js framework? #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. Hermes makes different trade-offs than other VMs in order to optimize for its core metrics. In particular, Hermes has no JIT (just in timer compiler), because JITs are mainly useful for improving the performance of longer running, CPU intensive programs. A JIT also consumes more memory than an interpreter. I expect that JS which is not React Native can benefit from Hermes, but not that Hermes will be an improvement for all possible JS programs. Given the very long evaluation time of vue.js on both VMs which you have measured, I suspect that the JIT is kicking in and JSC execution benefits from this. |
Another observation (thanks to @jbower-fb) is that if you use prepareJavaScript() on device, you are not getting the most optimized possible code. This is a tradeoff to reduce on-device compilation time and is intended for simple code or testing on slow devices. For production use, the engine design expects that the JS source is compiled offline. You should use the command line Another optimization which RN uses which you can use, too, is to mmap the bytecode instead of eagerly loading it. https://github.com/facebook/hermes/blob/master/API/jsi/jsi/jsilib.h#L14 is some library code which will do this for you. |
Summary: dogscience I'm just throwing code against the (gradle) wall and see what sticks. The problem with the previous setup was that it created two publications. While the outcome looked fine in general, it created two POM files which overwrote each other and the latter one created would not have all the meta data, causing Maven Central validation to fail. With this we're modifying the existing one(s) to add the headers JAR instead. Pull Request resolved: facebookincubator/fbjni#55 Test Plan: ./gradlew installArchives Checked my ~/.m2/ and now there's only one distribution, i.e. not multiple installations and, importantly, only one POM file. Reviewed By: IvanKobzarev Differential Revision: D27290376 Pulled By: passy fbshipit-source-id: d3e0a713ccec381f518867594607554d35f0b88e
Add win32 exports for creating a runtime with a default CrashManager implementation that forwards calls into Windows Error Reporting (Watson) and a crashHandler that can output details (such as callstack) to a file handle.
Hi,
I am trying to test the hermes to my android application but do not use RN.I added the related hermes
librarys and head files to my project and then after compiling and linking.It works in my application.
Previously I use the JavascriptCode as my js engine in my project and I make my test code like this:
First,I try to use the react.min.js to feed the hermes and JSC,the data is below and looks good:
then,I try to use the vue.js to feed the hermes and jsc,the data is below:
The JSC is fast a lot than the hermes even JSC use the pure javascript string and hermes use the bytecode .
So,I wanna to know,does the hermes make some specific optimize for react related javascript?and worried about whether other javascript can benfit form hermes.
The text was updated successfully, but these errors were encountered: