Skip to content

Commit b06dd03

Browse files
alan-agius4filipesilva
authored andcommitted
docs: update CPU profiling section
This section is outdated. Closes #20336
1 parent 033c441 commit b06dd03

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/angular/cli/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,26 +234,26 @@ For more informations about Node.js debugging in VS Code, see the related [VS Co
234234

235235
In order to investigate performance issues, CPU profiling is often useful.
236236

237-
To capture a CPU profiling, you can:
237+
#### Creating a profile
238238

239-
1. install the v8-profiler-node8 dependency: `npm install v8-profiler-node8 --no-save`
240-
1. set the NG_CLI_PROFILING Environment variable to the file name you want:
241-
- on Unix systems (Linux & Mac OS X): ̀`export NG_CLI_PROFILING=my-profile`
242-
- on Windows: ̀̀`setx NG_CLI_PROFILING my-profile`
239+
Node.js 16+ users can use the Node.js command line argument `--cpu-prof` to create a CPU profile.
243240

244-
Then, just run the ng command on which you want to capture a CPU profile.
245-
You will then obtain a `my-profile.cpuprofile` file in the folder from which you ran the ng command.
241+
```bash
242+
node --cpu-prof node_modules/.bin/ng build
243+
```
244+
245+
In addition to this one, another, more elaborated way to capture a CPU profile using the Chrome Devtools is detailed in https://github.com/angular/angular-cli/issues/8259#issue-269908550.
246+
247+
#### Opening a profile
246248

247249
You can use the Chrome Devtools to process it. To do so:
248250

249-
1. open `chrome://inspect/#devices` in Chrome
251+
1. open `chrome://inspect` in Chrome
250252
1. click on "Open dedicated DevTools for Node"
251253
1. go to the "profiler" tab
252-
1. click on the "Load" button and select the generated .cpuprofile file
254+
1. click on the "Load" button and select the generated `.cpuprofile` file
253255
1. on the left panel, select the associated file
254256

255-
In addition to this one, another, more elaborated way to capture a CPU profile using the Chrome Devtools is detailed in https://github.com/angular/angular-cli/issues/8259#issue-269908550.
256-
257257
## Documentation
258258

259259
The documentation for the Angular CLI is located on our [documentation website](https://angular.io/cli).

0 commit comments

Comments
 (0)