Skip to content

Commit 8886a5d

Browse files
authored
Update README.md
1 parent 3a53162 commit 8886a5d

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,73 @@
33

44
# react-native-cli-plugin-benchmark
55
React Native CLI Plugin for Benchmark Regression
6+
7+
## Installation
8+
```sh
9+
$ yarn add react-native-cli-plugin-benchmark
10+
```
11+
12+
## Supported Commands
13+
14+
### react-native get-appsize-ios
15+
Get the generated IPA size from run-ios output
16+
17+
```sh
18+
$ react-native get-appsize-ios --configuration Release --sdk iphoneos
19+
info Found Xcode workspace "RNApp.xcworkspace"
20+
info Building (using "xcodebuild -workspace RNApp.xcworkspace -configuration Release -scheme RNApp -sdk iphoneos CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO")
21+
info Generated app size:
22+
{"/Users/kudo/Library/Developer/Xcode/DerivedData/RNApp-auhfmjezpdwqwhasqmpbigmosgfe/Build/Products/Release-iphoneos/RNApp.app":37632}
23+
```
24+
25+
### react-native get-appsize-android
26+
Get the generated APK size from run-android output
27+
28+
```sh
29+
$ react-native get-appsize-android --variant release
30+
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
31+
info Building the app...
32+
info Generated app size:
33+
{"/Users/kudo/RNApp/android/app/build/outputs/apk/release/app-release.apk":19603464}
34+
```
35+
36+
### react-native measure-ios
37+
Measure from run-ios output
38+
Note that the command in fact to patch AppDelegate to log some information after 5 seconds from launch.
39+
The information are from RCTPerformanceLogger and task memory.
40+
41+
```sh
42+
$ react-native measure-ios --configuration Release --no-packager
43+
info Found Xcode workspace "RNApp.xcworkspace"
44+
info Launching iPhone X (iOS 12.4)
45+
info Building (using "xcodebuild -workspace RNApp.xcworkspace -configuration Release -scheme RNApp -destination id=6FF18363-C213-4E59-9A83-3117EE7AE6FE")
46+
▸ Compiling diy-fp.cc
47+
▸ Compiling bignum.cc
48+
▸ Compiling cached-powers.cc
49+
▸ Compiling double-conversion.cc
50+
...
51+
info Launching "org.reactjs.native.example.RNApp"
52+
success Successfully launched the app on the simulator
53+
info Measurement result:
54+
{
55+
"duration.RCTPLScriptDownload": "2",
56+
"duration.RCTPLScriptExecution": "181",
57+
"duration.RCTPLRAMBundleLoad": "0",
58+
"duration.RCTPLRAMStartupCodeSize": "0",
59+
"duration.RCTPLRAMStartupNativeRequires": "0",
60+
"duration.RCTPLRAMStartupNativeRequiresCount": "0",
61+
"duration.RCTPLRAMNativeRequires": "0",
62+
"duration.RCTPLRAMNativeRequiresCount": "0",
63+
"duration.RCTPLNativeModuleInit": "2",
64+
"duration.RCTPLNativeModuleMainThread": "56",
65+
"duration.RCTPLNativeModulePrepareConfig": "0",
66+
"duration.RCTPLNativeModuleMainThreadUsesCount": "4",
67+
"duration.RCTPLNativeModuleSetup": "0",
68+
"duration.RCTPLTurboModuleSetup": "0",
69+
"duration.RCTPLJSCWrapperOpenLibrary": "0",
70+
"duration.RCTPLBridgeStartup": "284",
71+
"duration.RCTPLTTI": "474",
72+
"duration.RCTPLBundleSize": "652466",
73+
"memory": "55541760"
74+
}
75+
```

0 commit comments

Comments
 (0)