Renan
Renan

Reputation: 1895

How to export Node.js V8 profiling info to Chrome's Dev Tools performance profile?

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.

Upvotes: 2

Views: 3030

Answers (2)

LitileXueZha
LitileXueZha

Reputation: 616

There are two ways for export .cpuprofile:

  • use cli options --cpu-prof
  • use inspector module. See the example usage

Upvotes: 2

jmrk
jmrk

Reputation: 40501

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.:

Upvotes: 3

Related Questions