Skip to content

Files

Latest commit

 

History

History

profiling

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ESlint-bridge profiling

This tool allows identifying the bottlenecks of a rule performance.

Fetch dependencies

Run: npm i

Chrome dev tools

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
  1. Boot the server in debug mode: npm run server. (or npm run compile-server if you have modifications in the TS source code)
  2. Open dev tools on chrome, using F12
  3. You should see a green NodeJS icon like that, click it to connect the dev tools to the server's debugger:

dev tools

  1. You might need to make sure the server starts by going to the "sources" tab and pressing the "play" button
  2. In the server logs, you should see that the server is listening
  3. Select the "Profiler" tab
  4. Select "Profiles" on the left
  5. Press "Start" on the bottom

profiler

  1. Launch the Analysis on ruling projects: npm run profile <my-rule-id> <ts|all> <parallelism>
    1. ts for TS-only projects, all for both JS and TS, JS-only by default.
    2. parallelism sets the number of parallel files sent to the bridge for analysis. Defaults to 5.
  2. Press "Stop"
  3. View the profile
  4. Change the view from "Heavy (Bottom Up)" to "Tree (Top Down)" (on the top menu, above "Self Time")

profile

  1. If you prefer, you can also select the "Chart" view to display a flame graph

flame graph

Links