Giter Club home page Giter Club logo

react-native-js-benchmark's Introduction

JavaScript Engine Benchmark for React Native

Benchmark Results

RN 0.62.2, JSC 250230, V8 8.0, Hermes 0.4.1

RN 0.60.3, JSC 245459, V8 7.5.1, Hermes 0.1.0

These benchmarks ran on Samsung Galaxy Note 5

Benchmarks

React Rendering

  • RenderComponentThroughput

    The series of test cases aim to measure how many React component could be rendered within some intervals.

    • RenderComponentThroughput 10s
    • RenderComponentThroughput 60s
    • RenderComponentThroughput 180s

    The reason that have different interval is that to assume JIT will start to work after longer repetitive executions.

    Higher result is better

TTI (Time-To-Interaction)

The series of test cases aim to measure how long JS engine parse and evaluate the scripts. TTI time is from the content_appear_view_time - before_start_ReactInstanceManager_time. In different test cases, we try to generate different size of JS bundle and compare if size matters.

  • TTI ~3 MiB bundle
  • TTI ~10 MiB bundle
  • TTI ~15 MiB bundle

APK Size

Simply the comparion of library binary size and final APK size.

How to Run the Benchmark

Prerequisites:

  • macOS 10.14 (Other macOS versions or Linux might be supported, but I don't verify that)
  • Python 3
  • Node 8+

Simply to run

python start.py -a

Disclaimer

This project is specific to measure JS engine performance for React Native. It is not designated to do generic JS engine comparison.

For example, on React Native Android, we don't enable all JIT tiers on JavaScriptCore. On V8, I am currently trying to use the JIT-less mode. What I am trying to do is balancing between good enough performance, low memory usage, and small binary size. That is why to disable JIT sometimes.

react-native-js-benchmark's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-js-benchmark's Issues

Update hermes

Hi!
Hermes version in benchmark is a little outdated - v0.1
Can you update it to the actual (0.4) version?

Feature request: Recent JSC versions

I know that Intl prevents you/us from publishing a newer version of JSC for react-native, but it would be quite interesting to see how much the difference is between the one shipping in RN and an up to date version with Intl.

Remove dependency on colorful

For folks who may not have colorful installed, running this seems to give and error. Does this really need colorful as a dep ?

P.S: Please feel free to close this issue since this is only a nit, and i ran into this when I tried the repo.

Crash when launching RNBenchmark JSC

Description

I want to get some test data through this script, but the program seems to have no response😥:

$ python3 start.py -a

#############################################
# Config
#############################################

---------------------------------------------
ABIs: armeabi-v7a
---------------------------------------------

JSC version: 245459.0.0
Meta: Baseline JIT (but not x86), WebKitGTK 2.24.2
Intl: False
JSC binary size:
	armeabi-v7a: -1 MiB


V8 version: 7.5.1
Meta: JIT-less (but not arm64-v8a), V8 7.5.288.23
Intl: True
V8 binary size:
	armeabi-v7a: -1 MiB


Hermes version: 0.1.0
Meta: JIT-less, bytecode precompile
Intl: False
Hermes binary size:
	armeabi-v7a: 1.16 MiB


#############################################
# RenderComponentThroughput Suite
#############################################

---------------------------------------------
RenderComponentThroughput 10s
---------------------------------------------

There are two application had been installed on my device by the Benchmark. However, one of them called RNBenchmark JSC crashed when it is running. I caught some information that might be useful:

2019-11-05 21:23:10.323 28674-28694/? E/SoLoader: couldn't find DSO to load: libhermes.so
    
    --------- beginning of crash
2019-11-05 21:23:10.323 28674-28694/? E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: com.rnbenchmark.jsc, PID: 28674
    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
        at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
        at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:949)
        at java.lang.Thread.run(Thread.java:764)

Why libhermes.so needs to be loaded when RNBenchmark JSC is launching?🤔
Could u give me some help?
Thank u!

Environment

  • macOS 10.14.6
  • Python 3
  • Node 8.12.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.