https://github.com/kudo/react-native-cli-plugin-benchmark
React Native CLI Plugin for Benchmark Regression
https://github.com/kudo/react-native-cli-plugin-benchmark
react-native react-native-cli
Last synced: 9 months ago
JSON representation
React Native CLI Plugin for Benchmark Regression
- Host: GitHub
- URL: https://github.com/kudo/react-native-cli-plugin-benchmark
- Owner: Kudo
- License: mit
- Created: 2020-02-18T11:25:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:36:02.000Z (about 3 years ago)
- Last Synced: 2024-10-31T13:33:04.673Z (about 1 year ago)
- Topics: react-native, react-native-cli
- Language: TypeScript
- Size: 1.9 MB
- Stars: 21
- Watchers: 5
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://badge.fury.io/js/react-native-cli-plugin-benchmark)

# react-native-cli-plugin-benchmark
React Native CLI Plugin for Benchmark Regression
## Installation
```sh
$ yarn add react-native-cli-plugin-benchmark
```
## Supported Commands
### react-native get-appsize-ios
Get the generated IPA size from run-ios output
```sh
$ react-native get-appsize-ios --configuration Release --sdk iphoneos
info Found Xcode workspace "RNApp.xcworkspace"
info Building (using "xcodebuild -workspace RNApp.xcworkspace -configuration Release -scheme RNApp -sdk iphoneos CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO")
info Generated app size:
{"/Users/kudo/Library/Developer/Xcode/DerivedData/RNApp-auhfmjezpdwqwhasqmpbigmosgfe/Build/Products/Release-iphoneos/RNApp.app":37632}
```
### react-native get-appsize-android
Get the generated APK size from run-android output
```sh
$ react-native get-appsize-android --variant release
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
info Building the app...
info Generated app size:
{"/Users/kudo/RNApp/android/app/build/outputs/apk/release/app-release.apk":19603464}
```
### react-native measure-ios
Measure from run-ios output
Note that the command in fact to patch AppDelegate to log some information after 5 seconds from launch.
The information are from RCTPerformanceLogger and task memory.
```sh
$ react-native measure-ios --configuration Release --no-packager
info Found Xcode workspace "RNApp.xcworkspace"
info Launching iPhone X (iOS 12.4)
info Building (using "xcodebuild -workspace RNApp.xcworkspace -configuration Release -scheme RNApp -destination id=6FF18363-C213-4E59-9A83-3117EE7AE6FE")
▸ Compiling diy-fp.cc
▸ Compiling bignum.cc
▸ Compiling cached-powers.cc
▸ Compiling double-conversion.cc
...
info Launching "org.reactjs.native.example.RNApp"
success Successfully launched the app on the simulator
info Measurement result:
{
"duration.RCTPLScriptDownload": "2",
"duration.RCTPLScriptExecution": "181",
"duration.RCTPLRAMBundleLoad": "0",
"duration.RCTPLRAMStartupCodeSize": "0",
"duration.RCTPLRAMStartupNativeRequires": "0",
"duration.RCTPLRAMStartupNativeRequiresCount": "0",
"duration.RCTPLRAMNativeRequires": "0",
"duration.RCTPLRAMNativeRequiresCount": "0",
"duration.RCTPLNativeModuleInit": "2",
"duration.RCTPLNativeModuleMainThread": "56",
"duration.RCTPLNativeModulePrepareConfig": "0",
"duration.RCTPLNativeModuleMainThreadUsesCount": "4",
"duration.RCTPLNativeModuleSetup": "0",
"duration.RCTPLTurboModuleSetup": "0",
"duration.RCTPLJSCWrapperOpenLibrary": "0",
"duration.RCTPLBridgeStartup": "284",
"duration.RCTPLTTI": "474",
"duration.RCTPLBundleSize": "652466",
"memory": "55541760"
}
```