|
1 | | -# Case Study — Nx graph time |
2 | | - |
| 1 | +# Perf Audit Base — Nx graph time |
3 | 2 |
|
4 | 3 | ## Tools and Setup |
5 | 4 |
|
@@ -28,10 +27,9 @@ Use native Node.js CPU profiling to analyze where time is spent when calculating |
28 | 27 |
|
29 | 28 | The following commands are executed from the root of a Nx workspace: |
30 | 29 | - `npx nx graph --file=nx-project-graph.json` - project graph generation |
31 | | - - `npx nx graph --groupByFolder --file=nx-project-graph-grouped.json` - project graph with grouped folders |
| 30 | + - (TO EVALUATE) `npx nx graph --groupByFolder --file=nx-project-graph-grouped.json` - project graph with grouped folders |
32 | 31 | - Remove plugins form nx.json, then run `npx nx graph --file=nx-project-graph-no-plugins.json` - project graph without plugins |
33 | 32 | - `npx nx graph --view=tasks --targets=<targets> --file=nx-task-graph-build.json` - task graph for specific target |
34 | | -- `npx nx graph --affected --base=main --file=/tmp/nx-affected-graph-main.json` - affected graph calculation for specified base |
35 | 33 |
|
36 | 34 | ### Project Graph (nx graph) |
37 | 35 |
|
@@ -113,26 +111,6 @@ npx -y @push-based/cpu-prof \ |
113 | 111 | node ./node_modules/nx/bin/nx.js graph --view=tasks --targets=<targets> --file=nx-task-graph-build.json |
114 | 112 | ``` |
115 | 113 |
|
116 | | - |
117 | | -### Affected Graph (base=main) |
118 | | - |
119 | | -1. Save setup specification: |
120 | | - |
121 | | -```bash |
122 | | -mkdir -p ./profiles/nx-affected-graph-main && \ |
123 | | -nx reset && nx report > ./profiles/nx-affected-graph-main/nx-report.md |
124 | | -``` |
125 | | - |
126 | | -2. Measure the affected graph calculation for the specified base: |
127 | | - |
128 | | -```bash |
129 | | -# Prerequisite (once): install local deps so ./node_modules/.bin/nx exists |
130 | | -NX_DAEMON=false NX_CACHE=false \ |
131 | | -npx -y @push-based/cpu-prof \ |
132 | | ---cpu-prof-dir ./profiles/nx-affected-graph-main \ |
133 | | -node ./node_modules/nx/bin/nx.js graph --affected --base=main --file=/tmp/nx-affected-graph-main.json |
134 | | -``` |
135 | | - |
136 | 114 | --- |
137 | 115 |
|
138 | 116 | ### Project Graph |
|
0 commit comments