1

According to Node.js documentation profiling info can be generated using node --prof myapp.js.

Is there a way to convert from this generated format to Chrome's Dev Tools performance profile? It expects to load a JSON format while the format generated by node --prof is not JSON.

Renan
  • 1,705
  • 2
  • 15
  • 32

2 Answers2

2

No, the output generated by the --prof flag is not what DevTools expects, and AFAIK there's no way to convert it.

However, there is also the --inspect flag, allowing you to use DevTools with Node, including profiling. I haven't tried it myself, but a quick search turns up e.g.:

jmrk
  • 34,271
  • 7
  • 59
  • 74
1

There are two ways for export .cpuprofile:

  • use cli options --cpu-prof
  • use inspector module. See the example usage
LitileXueZha
  • 512
  • 6
  • 11