Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/angular/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,26 +234,26 @@ For more informations about Node.js debugging in VS Code, see the related [VS Co

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

To capture a CPU profiling, you can:
#### Creating a profile

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

Then, just run the ng command on which you want to capture a CPU profile.
You will then obtain a `my-profile.cpuprofile` file in the folder from which you ran the ng command.
```bash
node --cpu-prof node_modules/.bin/ng build
```

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.

#### Opening a profile

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

1. open `chrome://inspect/#devices` in Chrome
1. open `chrome://inspect` in Chrome
1. click on "Open dedicated DevTools for Node"
1. go to the "profiler" tab
1. click on the "Load" button and select the generated .cpuprofile file
1. click on the "Load" button and select the generated `.cpuprofile` file
Comment thread
alan-agius4 marked this conversation as resolved.
1. on the left panel, select the associated file

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.

## Documentation

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