react-native-v8 icon indicating copy to clipboard operation
react-native-v8 copied to clipboard

React Native 0.62 support

Open kesha-antonov opened this issue 4 years ago • 31 comments

Hi! Is it planned?

kesha-antonov avatar Mar 30 '20 12:03 kesha-antonov

same, Hope to support soon

songxiaoliang avatar Mar 31 '20 01:03 songxiaoliang

Thanks @enahum's help for sending #41 for upgrade. I've published [email protected]. Please take a look.

Kudo avatar Mar 31 '20 03:03 Kudo

Awesome @Kudo, will replace our fork with the npm package and report back here in about 10 hours ;)

enahum avatar Mar 31 '20 03:03 enahum

this is working as intended with RN v0.62.0 installed from the npm package.

Thanks @Kudo for the timely PR review/merge and publishing the package

enahum avatar Mar 31 '20 13:03 enahum

Are there any benchmarks for this against Hermes 0.4.0?

nonewcode avatar Mar 31 '20 17:03 nonewcode

@Kudo If I don't need intl, can I just install v8-android-nointl, or do I need to install both react-native-v8 and v8-android-nointl?

songxiaoliang avatar Apr 03 '20 12:04 songxiaoliang

@songxiaoliang react-native-v8 is the base library you need that handles everything. Along with that you need v8-android or v8-android-nointl installed too.

ammarahm-ed avatar Apr 07 '20 07:04 ammarahm-ed

@ammarahm-ed thanks, I have solved this problem through practice. anyway, Currently I am trying the difference between herms and react-native-v8

songxiaoliang avatar Apr 07 '20 07:04 songxiaoliang

@songxiaoliang If you are creating a memory intensive application, v8 is the best choice to go, it has great garbage collection and memory usage does not peak.

ammarahm-ed avatar Apr 08 '20 10:04 ammarahm-ed

@Kudo can you release 0.62.1 on npm? there is no needed changes on the patch, running the script is be enough (ran it locally and is all good, but I can't publish :P)

enahum avatar Apr 08 '20 18:04 enahum

0.62.2 now :)

nonewcode avatar Apr 08 '20 20:04 nonewcode

yeah, no changes needed for 0.62.2 either

enahum avatar Apr 08 '20 20:04 enahum

Published v0.62.1-patch.0 and 0.62.2-patch.1, please let me know if there are any further questions. (Please do not use 0.62.2-patch.0, which is incorrect version from my publish fault.)

Kudo avatar Apr 09 '20 16:04 Kudo

@codecog

Are there any benchmarks for this against Hermes 0.4.0?

Will find some time to do that. My recent works is about to add inspector support. Ideally we could do direct debugging and support TurboModules like Hermes.

Kudo avatar Apr 09 '20 16:04 Kudo

@Kudo Fantastic work. We were trying to come to a decision based on stats to switch over to V8 from hermes.

Are the benchmarking's available ?

Jeevan-Kishore avatar May 18 '20 15:05 Jeevan-Kishore

@Jeevan-Kishore @codecog I've just updated react-native-js-benchmark to compare JSC 230250, V8 8.0 and Hermes 0.4.1. The result is here - https://docs.google.com/spreadsheets/d/1XB6fuk-NYZbCDikxQOAJemE-P8cfbsfdXivTeVwcwIk/edit?usp=sharing

Kudo avatar May 20 '20 02:05 Kudo

@Kudo Thanks for your work and the benchmark, jsc looks better than Hermes and v8 from the results ? So using up to date jsc with this library https://github.com/react-native-community/jsc-android-should get better performances than v8 ?

magrinj avatar May 20 '20 13:05 magrinj

I am sorry that I had a mistake to run benchmarks yesterday. (RNV8 not updated). I've re-examined again with some changes:

  1. Use arm64-v8a ABI to test
    • Many devices are arm64 right now.
    • V8 assumes to use less memory due to its Pointer Compression feature.
  2. Add V8 JIT variant into the benchmark result.

@magrinj It's hard to say which JS runtime is better. There were some configurations that may impact to the result. For JSC, it has four tiers of JIT model and we disabled some of them. For V8, by default I use the Lite Mode (JIT-less mode). For Hermes, officially they don't have JIT. You could see the updated Google Sheet, V8 with JIT acts 2x better than others in RenderComponentThroughput test case.

IMO, I would use V8 if apps need heavy JS computing. Otherwise, Hermes is good enough especially its binary size is really really small.

Kudo avatar May 21 '20 05:05 Kudo

@Kudo is Jit activated on the android package? If not, how would i go about adding this? Appreciate the work you put in here.

nonewcode avatar May 21 '20 05:05 nonewcode

@codecog It's my fault not updated the document. There are packages like v8-android-jit or v8-android-jit-nointl, credit from @sirpy at https://github.com/Kudo/v8-android-buildscripts/pull/9 The integration is pretty much like this

I will update the document later.

Kudo avatar May 21 '20 05:05 Kudo

@Kudo Thanks for the direction

nonewcode avatar May 21 '20 05:05 nonewcode

Hi! I am experiencing a significant performance degradation (specially with animations) after the upgrade to [email protected] and [email protected] (from 0.61.4 and 0.61.1-patch.0 respectively). Is this something expected?

gpawlik avatar Jun 02 '20 12:06 gpawlik

@gpawlik Could you try RN 0.62.2 with JSC or Hermes? I was curious if the degradation comes from RN.

On the other hand, please help me to double check the v8-android* version you used before and after upgrade.

Kudo avatar Jun 11 '20 01:06 Kudo

Thanks @Kudo , I have been using v8-android 7.5.1 and upgraded to 8.80.1. I have tried RN 62.2 with hermes and there was a slight improvement comparing with v8, and then tried with jsc and the performance problem has gone (app is still a little bit slower than on v8 but acceptable).

gpawlik avatar Jun 11 '20 20:06 gpawlik

@gpawlik I am sorry that getting a little confused from the description:

the performance problem has gone (app is still a little bit slower than on v8 but acceptable).

It looks like Hermes and JSC has no performance issue on RN 0.62.2 but only V8, right?

Kudo avatar Jun 15 '20 01:06 Kudo

Only JSC has no performance issues, v8 has serious issues when it comes to screen transitions, animations and any touchable interactions. The performance isn't much better on Hermes, but I haven't tried it before 0.62.2 so it is difficult to compare.

gpawlik avatar Jun 15 '20 07:06 gpawlik

@gpawlik do you know what may be causing the perf degradation in your code?

In our app, we can use JSC and V8 no problem at all, but if we switch to hermes, we started to see horrible degradation as you described, but the code is so massive that we couldn’t track it down to anything specific.

enahum avatar Jun 15 '20 08:06 enahum

@enahum unfortunately I was not able to track down the exact cause of this degradation (similarly, our codebase is massive), but in the coming weeks I might spend more time doing this investigation so I will keep you updated.

gpawlik avatar Jun 15 '20 08:06 gpawlik

The current JSC has lightweight JIT. From my previous benchmark, the JSC has better performance than Hermes or V8 (not the v8-android-jit version).

However, performance highly depends on applications. Do you use Animated, Animated with native driver or even Reanimated?

Kudo avatar Jun 18 '20 06:06 Kudo

Yes, I use Animated (with useNativeDriver specified), although the performance degradation happen equally on screens and components with no animations at all and with simple interactions like button tap, etc.

gpawlik avatar Jun 18 '20 08:06 gpawlik