If Gratos runs slowly in your project, capture a CPU profile and share it with the Gratos maintainers, to help find performance improvements.

Capturing a performance profile

Node.js profiles the CPU with its --cpu-prof flag. To profile a Gratos run, from your project's directory:

node --cpu-prof --cpu-prof-name=gratos-profile.cpuprofile ./node_modules/gratos/dist/cli.js

This:

  1. runs Gratos on your project;
  2. writes a CPU profile to gratos-profile.cpuprofile in the current directory.

Viewing the profile

  1. Open Chrome and navigate to chrome://inspect.
  2. Click "Open dedicated DevTools for Node".
  3. Go to the Performance tab.
  4. Click Load profile, and select your .cpuprofile file.

Sharing the profile

To report a performance issue:

  1. Run the profiling command above.
  2. Open a GitHub issue.
  3. Attach the .cpuprofile file to the issue.
  4. Include the version of Gratos you have installed (gratos --version).