Skip to content
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

Performance: V8 JSI calls are 4-6 times slower than Hermes/JSC (iOS) #185

Open
ammarahm-ed opened this issue Jul 5, 2023 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@ammarahm-ed
Copy link
Contributor

ammarahm-ed commented Jul 5, 2023

Hey Kudo, I have been doing some testing to check v8 JSI performance compared to Hermes/JSC and I have found out that it's 4-6 times slower than Hermes/JSC. The issue seems to be related to the V8 JSI implementation rather than a v8 issue.

All benchmarks below were run on the same iPhone 6S device.

React Native v8 JSI:
v8

Pure v8 (v10.x) calls vs v8 JSI in a NativeScript app take only 200ms:
rn_image_picker_lib_temp_e2f353e5-1964-4cef-8203-6f74b1690ed5

JSC JSI (Fastest of all):
rn_image_picker_lib_temp_ee3d89fd-9329-4de1-926e-1931eb5c0f52

Hermes JSI:

 LOG  Running "ReactNative" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
 LOG  318.93000000715256 ms (Primitives)
 LOG  353.515625 ms (Strings)
 LOG  3873.240542009473 ms (Big data marshalling)
 LOG  272.34741701185703 ms (Strings with arraybuffer)
 LOG  890.5701670050621 ms (Big data marshalling with arr

Repro Expo Sample: https://github.com/ammarahm-ed/v8-jsi-benchmarks-ios

The issue might be related to: #179

@ammarahm-ed ammarahm-ed changed the title v8 JSI calls are 4-6 times slower than Hermes/JSC (iOS) Performance: V8 JSI calls are 4-6 times slower than Hermes/JSC (iOS) Jul 5, 2023
@Kudo
Copy link
Owner

Kudo commented Aug 20, 2023

hi @ammarahm-ed, sorry for late response. besides #179 locking issue, people also reported performance regression from v8 11, so i had downgraded v8 to 10 for android. unfortunately, v8-ios doesn't support v8 10, i will try to upgrade to newer v8 to see if that helps.

@Kudo Kudo added the bug Something isn't working label Aug 20, 2023
@Kudo Kudo self-assigned this Aug 20, 2023
@ammarahm-ed
Copy link
Contributor Author

hi @ammarahm-ed, sorry for late response. besides #179 locking issue, people also reported performance regression from v8 11, so i had downgraded v8 to 10 for android. unfortunately, v8-ios doesn't support v8 10, i will try to upgrade to newer v8 to see if that helps.

After opening the issue here, I made some changes to the V8 jsi runtime that resulted in 3-4x performance improvement in function calls. Some of those might be overkill but I can open a PR if you want to take a look some time.

@Kudo
Copy link
Owner

Kudo commented Sep 2, 2023

After opening the issue here, I made some changes to the V8 jsi runtime that resulted in 3-4x performance improvement in function calls. Some of those might be overkill but I can open a PR if you want to take a look some time.

that's awesome, 3-4x improvement is much. appreciated if you could help to create a PR when you get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants