Skip to content

Commit e10f74e

Browse files
matz3RandomByte
andauthored
docs: Update Benchmarking for monorepo setup (#1192)
Also consistently link to ui5.sap.com SDK. (cherry picked from commit 76d6f6f) --------- Co-authored-by: Merlin Beutlberger <[email protected]>
1 parent dacd4d3 commit e10f74e

File tree

2 files changed

+42
-55
lines changed

2 files changed

+42
-55
lines changed

packages/documentation/docs/pages/Benchmarking.md

Lines changed: 41 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,59 @@ For benchmarking UI5 CLI we typically make use of the open source tool [hyperfin
44

55
In general we only benchmark calls to the UI5 CLI. However, we might add scripted benchmarks for some components in the future.
66

7-
The following is a walk-through on how to evaluate the performance impact of an imaginary change in the UI5 Builder project.
7+
The following is a walk-through on how to evaluate the performance impact of changes to the UI5 CLI `build` command.
88

99
## Setup
1010

1111
1. Install [hyperfine](https://github.com/sharkdp/hyperfine#installation)
12-
1. Prepare the UI5 CLI projects you want to measure *(optional if your development environment already reflects this)*:
13-
1. Start in an empty directory
12+
2. Prepare the UI5 CLI repository *(optional if your development environment already reflects this)*:
13+
1. Clone [UI5 CLI](https://github.com/UI5/cli) (or your fork) and navigate into it
1414
```sh
15-
mkdir ui5-cli-benchmark && cd ui5-cli-benchmark/
16-
```
17-
1. Clone [UI5 CLI](https://github.com/SAP/ui5-cli)
18-
```sh
19-
git clone [email protected]:SAP/ui5-cli.git
20-
```
21-
1. Clone [UI5 Builder](https://github.com/SAP/ui5-builder) (or your fork)
22-
```sh
23-
git clone [email protected]:SAP/ui5-builder.git
15+
git clone [email protected]:UI5/cli.git
16+
cd cli
2417
```
2518
Make sure you check out the `main` branch, since we'll perform the baseline test first
26-
1. Install npm dependencies in both directories
27-
```sh
28-
(cd ui5-cli && npm install)
29-
(cd ui5-builder && npm install)
30-
```
31-
1. Create global npm links for both projects
19+
2. Install npm dependencies
3220
```sh
33-
(cd ui5-cli && npm link)
34-
(cd ui5-builder && npm link)
21+
npm install
3522
```
36-
1. Link UI5 Builder into UI5 CLI
23+
3. Create a global npm link for `@ui5/cli`
3724
```sh
38-
(cd ui5-cli && npm link @ui5/builder)
25+
(cd packages/cli && npm link)
3926
```
40-
1. Verify your setup
27+
4. Verify your setup
4128
```sh
4229
ui5 --version
4330
```
4431
This should output the version and location of the UI5 CLI you just cloned.
4532
4633
For example:
4734
```
48-
3.0.0 (from /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs)
35+
5.0.0 (from /my/home/UI5/cli/packages/cli/bin/ui5.cjs)
4936
```
5037
51-
1. Prepare your test project (we choose the [openui5-sample-app](https://github.com/SAP/openui5-sample-app))
38+
3. Prepare your test project (we choose the UI5 [sample-app](https://github.com/UI5/sample-app))
5239
1. Clone the project
5340
```sh
54-
git clone [email protected]:SAP/openui5-sample-app.git
41+
git clone [email protected]:UI5/sample-app.git
5542
```
56-
1. Navigate into the project
43+
2. Navigate into the project
5744
```sh
58-
cd openui5-sample-app
45+
cd sample-app
5946
```
60-
1. Install any required npm dependencies
47+
3. Install any required npm dependencies
6148
```sh
6249
npm install
6350
```
6451
Note: We won't link UI5 CLI into this project. Instead, we'll call it directly.
65-
1. Verify that the previously installed UI5 CLI can be called with the following command:
52+
4. Verify that the previously installed UI5 CLI can be called with the following command:
6653
```sh
67-
UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs --version
54+
UI5_CLI_NO_LOCAL=X node /my/home/UI5/cli/packages/cli/bin/ui5.cjs --version
6855
```
6956
On Windows:
7057
```sh
71-
set UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs --version
58+
set UI5_CLI_NO_LOCAL=X
59+
node C:\my\home\UI5\cli\packages\cli\bin\ui5.cjs --version
7260
```
7361
*(Replace the path to ui5.cjs with the one shown in the previous `ui5 --version` output)*
7462
@@ -84,55 +72,54 @@ The following is a walk-through on how to evaluate the performance impact of an
8472
1. In the project, start your first benchmark
8573
```sh
8674
hyperfine --warmup 1 \
87-
'UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs build' \
75+
'UI5_CLI_NO_LOCAL=X node /my/home/UI5/cli/packages/cli/bin/ui5.cjs build' \
8876
--export-markdown ./baseline.md
8977
```
9078
On Windows:
9179
```sh
92-
hyperfine --warmup 1 \
93-
'set UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs build' \
94-
--export-markdown ./baseline.md
80+
set UI5_CLI_NO_LOCAL=X
81+
hyperfine --warmup 1 "node C:\my\home\UI5\cli\packages\cli\bin\ui5.cjs build" --export-markdown
82+
./baseline.md
9583
```
9684
1. Your baseline benchmark is now stored in `baseline.md` and should look similar to this:
9785
9886
| Command | Mean [s] | Min [s] | Max [s] | Relative |
9987
|:---|---:|---:|---:|---:|
100-
| `UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs build` | 1.439 ± 0.036 | 1.400 | 1.507 | 1.00 |
88+
| `UI5_CLI_NO_LOCAL=X node /my/home/UI5/cli/packages/cli/bin/ui5.cjs build` | 1.439 ± 0.036 | 1.400 | 1.507 | 1.00 |
10189
10290
1. Prepare your change
10391
1. Switch to the branch that contains your change
10492
```sh
105-
(cd ../packages/builder && git checkout my-change)
93+
git checkout my-change
10694
```
10795
1. If your change requires different npm dependencies, reinstall them
10896
```sh
109-
(cd ../packages/builder && npm install)
97+
npm install
11098
```
111-
1. The link from UI5 CLI is still in place. However, if you have changes in **multiple** UI5 CLI modules, you might need to `npm link` those again
99+
2. The link from UI5 CLI is still in place.
112100
113-
1. Perform the change measurement
101+
2. Perform the change measurement
114102
1. In the project, start your second benchmark
115103
```sh
116104
hyperfine --warmup 1 \
117-
'UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs build' \
105+
'UI5_CLI_NO_LOCAL=X node /my/home/UI5/cli/packages/cli/bin/ui5.cjs build' \
118106
--export-markdown ./my_change.md
119107
```
120108
On Windows:
121109
```sh
122-
hyperfine --warmup 1 \
123-
'set UI5_CLI_NO_LOCAL=X node /my/home/ui5-cli-benchmark/ui5-cli/bin/ui5.cjs build' \
124-
--export-markdown ./my_change.md
110+
set UI5_CLI_NO_LOCAL=X
111+
hyperfine --warmup 1 "node C:\my\home\UI5\cli\packages\cli\bin\ui5.cjs build" --export-markdown ./my_change.md
125112
```
126-
1. Your change's benchmark is now stored in `my_change.md`
113+
2. Your change's benchmark is now stored in `my_change.md`
127114

128115
## Compile Results
129116

130117
1. Merge both measurements into one markdown
131118
1. In this setup, Hyperfine can't correctly calculate the relative difference between results. The respective column always reads "1". Either remove the "Relative" column or calculate the relative difference yourself:
132119
* Use this formula to calculate the percentage increase based on the *Mean* result:
133120
`(newMean - baselineMean) / baselineMean * 100`
134-
^^JavaScript function:^^
135-
`#!js function calcDiff(baseVal, newVal) {return (newVal - baseVal) / baseVal * 100;}`
121+
JavaScript function:
122+
``` function calcDiff(baseVal, newVal) {return (newVal - baseVal) / baseVal * 100;}```
136123
137124
* **Example for a performance improvement:**
138125
Baseline of 10 seconds decreased to 7 seconds:
@@ -146,17 +133,17 @@ The following is a walk-through on how to evaluate the performance impact of an
146133
1. Change the command column to only contain the relevant `ui5 build` command, including any parameters. E.g. `ui5 build --all`
147134
1. You should end up with a markdown like this:
148135
```md
149-
ui5-builder Ref | Command | Mean [s] | Min [s] | Max [s] | Relative
136+
| UI5/cli Ref | Command | Mean [s] | Min [s] | Max [s] | Relative |
150137
|:---|:---|---:|---:|---:|---:|
151-
| main ([`1234567`](https://github.com/SAP/ui5-builder/commit/<sha>)) | `ui5 build` | 1.439 ± 0.036 | 1.400 | 1.507 | Baseline |
152-
| feature-duck ([`9101112`](https://github.com/SAP/ui5-builder/commit/<sha>)) | `ui5 build` | 1.584 ± 0.074 | 1.477 | 1.680 | **+10%** |
138+
| main ([`1234567`](https://github.com/UI5/cli/commit/<sha>)) | `ui5 build` | 1.439 ± 0.036 | 1.400 | 1.507 | Baseline |
139+
| feature-duck ([`9101112`](https://github.com/UI5/cli/commit/<sha>)) | `ui5 build` | 1.584 ± 0.074 | 1.477 | 1.680 | **+10%** |
153140
```
154141
Rendering like this:
155142
156-
| ui5-builder Ref | Command | Mean [s] | Min [s] | Max [s] | Relative |
143+
| UI5/cli Ref | Command | Mean [s] | Min [s] | Max [s] | Relative |
157144
|:---|:---|---:|---:|---:|---:|
158-
| main ([`1234567`](https://github.com/SAP/ui5-builder/commit/<sha>)) | `ui5 build` | 1.439 ± 0.036 | 1.400 | 1.507 | Baseline |
159-
| feature-duck ([`9101112`](https://github.com/SAP/ui5-builder/commit/<sha>)) | `ui5 build` | 1.584 ± 0.074 | 1.477 | 1.680 | **+10%** |
145+
| main ([`1234567`](https://github.com/UI5/cli/commit/<sha>)) | `ui5 build` | 1.439 ± 0.036 | 1.400 | 1.507 | Baseline |
146+
| feature-duck ([`9101112`](https://github.com/UI5/cli/commit/<sha>)) | `ui5 build` | 1.584 ± 0.074 | 1.477 | 1.680 | **+10%** |
160147
161148
1. You can now share these results on GitHub or wherever you might need them.
162149

packages/documentation/docs/updates/migrate-v4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ This might be caused by a mismatch of your project's manifest version and your U
135135

136136
UI5 CLI v4 enhances the manifest.json with information about the `supportedLocales` (also see [Builder: Generation of Supported Locales](../pages/Builder.md#generation-of-supported-locales)). In UI5 1.71 this configuration is not supported and leads to an ambiguous error message `TypeError: invalid input` and a failure to process the manifest file.
137137

138-
UI5 CLI uses the manifest's `_version` property to decide whether the `supportedLocales` can be generated. For UI5 1.71, only versions up to `1.17.0` are supported. See [UI5 Demo Kit: Descriptor for Applications, Components, and Libraries (manifest.json)](https://sdk.openui5.org/#/topic/be0cf40f61184b358b5faedaec98b2da) for a mapping per manifest version.
138+
UI5 CLI uses the manifest's `_version` property to decide whether the `supportedLocales` can be generated. For UI5 1.71, only versions up to `1.17.0` are supported. See [UI5 Demo Kit: Descriptor for Applications, Components, and Libraries (manifest.json)](https://ui5.sap.com/#/topic/be0cf40f61184b358b5faedaec98b2da) for a mapping per manifest version.
139139

140140
To resolve this issue, adjust the manifest version according to the UI5 version you are using.
141141

0 commit comments

Comments
 (0)