-
Notifications
You must be signed in to change notification settings - Fork 33
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
Hermes Engine takes 2.5 to 19 times longer to process promises than Chakra #92
Comments
From your steps, you mentioned opening the RNW developer menu. Are you running a debug build of your application? Chakra exposes it's APIs to react-native-windows in the form of ABI-safe C functions. It lets RNW debug builds use a release version of Chakra. The Hermes boundary is not yet ABI safe, and MSVC has different debug snd release ABIs. This currently forces RNW to use an "optimized debug build" of Hermes, which performs worse than its release optimized build. This constraint go away I think, with work to move JS engine interface to be ABI safe. But right now Hermes direct debugging, like web debugging, is not representative of release build performance. Debug-time developer experience is still super important though. Did switching to Hermes direct debugging degrade that for your app? |
Also from your steps you are not comparing Chakra vs Hermes at all. When you enable remote debugging, you are running the JS inside a webbrowser (either Edge or Chrome probably) - both of which use V8. When running the JS in a browser you are running inside a very different JS environment including a completely different promise implementation. There are so many differences between how things run in "Remote Debugging" env, that it should not be used for any kind of performance testing. |
Yes, all tests were performed with a For our actual application, which my test repository is imitating, we do indeed have about a 20 second load screen time which is similar to the 10K Nested Promise test in the referenced repository. I have gone back and rebuilt and tested in a |
I can go ahead and provide you with updated results from Chakra in release for the repository in question. |
I have tested Chakra with both Debug and Release. Results are as follows: Important to note; for the larger Nested Promise tests, Chakra Debug outperforms Hermes in Release. |
- Disable Stats Timer (fixes #92) - Include revision as part of product version in addition to suffix (fixes #91) - Include license file in NuGet (fixes #98) - Add Source Link to linker (fixes #102) This is ported from the v0.11 branch. We bump the version up to 0.12 (even though no such version exists in upstream) to signal we're no longer compatible with 0.11 (and RN 0.68).
@AlexLablaiksSAP I am reopening the issue. The next steps:
|
Problem Description
We have recently switched to Hermes to leverage Direct Debugging via VSCode. Unfortunately, we have been noticing that large datasets have been taking around 20 times longer in Hermes to process promises verses Chakra. Specifically, datasets that take 1.2 seconds with Chakra verses 25 seconds with Hermes.
I have been able to reproduce this with a simple React Native app available at hermes-promise-test, which uses version
0.68.0
. Our metadata application often processes fields based on various rule sets. I have replicated this in the aforementioned repository by formatting the data set field values to uppercase or lowercase. The results are as follows:Promise.all()
for every field (6)) of 1,000 objects: 379 ms vs 9 ms or 41 times longer for Hermes.Steps To Reproduce
Ctrl
+Shift
+D
and selecting "<Enable/Disable> Remote JS Debugging".Mock Data with Flat Promises
orMock Data with Nested Promises
Get 1k Object Cells
orGet 10k Object Cells
to populate data.Format
button to process the data set. Note that times will appear in the console log.Expected Results
Hermes to perform similar or better than Chakra.
CLI version
7.0.3
Environment
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2019
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
https://github.com/AlexLablaiksSAP/hermes-promise-test
The text was updated successfully, but these errors were encountered: