microsoft / hermes-windows

Hermes is a small and lightweight JavaScript engine optimized for running React Native apps..
https://hermesengine.dev
MIT License
47 stars 33 forks source link

Hermes Engine takes at least 2x more time to resolve promises.all than Chakra #183

Open i-xarlos opened 2 months ago

i-xarlos commented 2 months ago
          @AlexLablaiksSAP I am reopening the issue.

As we discussed with your team today, I clearly see the same issue playing with your repro. From what I see in the WPA (Windows Perf Analysis tooling), where are no significant delays in the JS thread. The most of time is spent inside of the Hermes interpreter. The function that seems to be the most expensive is the Array.indexOf(). image

The next steps:

Originally posted by @vmoroz in https://github.com/microsoft/hermes-windows/issues/92#issuecomment-1577047073

i-xarlos commented 2 months ago

In tests we have done it can be verified:

Hermes engine for windows takes at least twice (2X) as long to resolve promise.all, doesn't matter if it's Intel or AMD the results are the same. Using Chakra engine takes half the time in all tests.

The impact that we have verified is in the lower index that is verified in this description: https://github.com/microsoft/hermes-windows/issues/92

Technical details of the machines where the tests were carried out using 160 promises (Promise.All):

Operating system Name: Microsoft Windows 11 Home Version: 10.0.22631

Dependencies for React Native Windows: "react": "18.2.0" "react-native": "0.72.7" "react-native-windows": "0.72.32"

Processor & Memory Processor: AMD Ryzen 3 7320U with Radeon Graphics
Physical memory: 8 GiB

Processor & Memory Processor: AMD Ryzen 7 7736U with Radeon Graphics
Physical memory: 16 GiB

Processor & Memory Processor: Intel(R) Core(TM) 7 150U Physical memory: 16 GiB