This tool allows identifying the bottlenecks of a rule performance.
Run: npm i
The Chrome dev tools allow you to see what functions took how much CPU time as:
- a top-down tree
- a bottom-up tree
- a (flame) graph
- Boot the server in debug mode:
npm run server
. (ornpm run compile-server
if you have modifications in the TS source code) - Open dev tools on chrome, using F12
- You should see a green NodeJS icon like that, click it to connect the dev tools to the server's debugger:
- You might need to make sure the server starts by going to the "sources" tab and pressing the "play" button
- In the server logs, you should see that the server is listening
- Select the "Profiler" tab
- Select "Profiles" on the left
- Press "Start" on the bottom
- Launch the Analysis on ruling projects:
npm run profile <my-rule-id> <ts|all> <parallelism>
ts
for TS-only projects,all
for both JS and TS, JS-only by default.parallelism
sets the number of parallel files sent to the bridge for analysis. Defaults to 5.
- Press "Stop"
- View the profile
- Change the view from "Heavy (Bottom Up)" to "Tree (Top Down)" (on the top menu, above "Self Time")
- If you prefer, you can also select the "Chart" view to display a flame graph