Skip to content

Commit

Permalink
chore: update ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mistryswapnil-dream11 committed Mar 13, 2024
1 parent 0c17dcb commit 7c25137
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
7 changes: 5 additions & 2 deletions Benchamrking/scripts/node/getFlashlightScore.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const packageJson = require("../../package.json")
const { execSync } = require("child_process")

globalThis.process.env.MAESTRO_RENDER_ANIMATION_BUTTON='render_animations'
globalThis.process.env.MAESTRO_ANIMATION_CONTAINER='animation_continer'

const appId = globalThis.process.argv[2]
const iterationCount = globalThis.process.argv[3] || 1


const stdio = {
stdio: "inherit"
}

const rootDirectoryPath = '../../../Reports'
const reportsDirectoryPath = `${rootDirectoryPath}/${packageJson.dependencies["react-native"]}/android`

if (!appId) {
console.log("App id must be specified to run automation script.")
Expand All @@ -20,5 +23,5 @@ if (!appId) {
execSync(`flashlight test --bundleId ${appId} \
--testCommand "maestro test -e APP_ID=${appId} ../automation/flashlightflow.yaml" \
--duration 10000 \
--resultsFilePath ${rootDirectoryPath}/flashlightscore.json \
--iterationCount 1`, stdio)
--resultsFilePath ${reportsDirectoryPath}/flashlightscore.json \
--iterationCount ${iterationCount}`, stdio)
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,25 @@ yarn install
3. This scripts will help getting numbers for time taken to render N views, texts, images component and flashlight score for spin animations of N views.
5. Run the following to get rendering time of N views, texts, images (tested on Android emulator & iOS Simulator):
```
yarn get:numbers:android <IterationCount>
// Example: yarn get:numbers:android 10
yarn get:numbers:ios <IterationCount>
// Example: yarn get:numbers:ios 10
yarn get:numbers:android <ITERATION_COUNT>
/* Example: yarn get:numbers:android 10 */
yarn get:numbers:ios <ITERATION_COUNT>
/* Example: yarn get:numbers:ios 10 */
```
6. Run the following command to get flashlight score (supported only on Android):
```
yarn get:flashlight:score
yarn get:flashlight:score <ITERATION_COUNT>
/* Example: yarn get:flashlight:score 10
Defaults to 1 iteration
*/
```

> NOTE: 1. Benchmarking numbers can be found at same locations for respective platform's as specfied above. 2. Flashlight report can be found under **Reports** directory with name **flashlightscore.json**.
7. Check flashlight score by running:
```
flashlight report <PATH_TO_FLASHLIGHT_REPORT>
/* Example: flashlight report ../Reports/0.73.5/android/flashlightscore.json (assuming you are inside Benchamrking/ directory) */
```
NOTE:
1. After running automation scripts the benchmarking numbers can be found under Reports/
2. So, if we are benchmarking for react-native version 0.73.5 the rendering benchmarking numbers will be found under Reports/0.73.5/android for android & Reports/0.73.5/ios for iOS for both architecture
3. Since flashlight is only supported on android the flashlight score can be found under Reports/<react-native-version>/android
```

0 comments on commit 7c25137

Please sign in to comment.