I try to profile my (typescript) app, which runs in node.js using the instructions from the nodejs.org simple profiling guide. However, the positions are those in the compiled js source file as run by node.
(How) is it possible to enable source map support for the step, to see the locations in the ts source files?
node --prof-process isolate-0xnnnnnnnnnnnn-v8.log > processed.txt
As of August 2017 I did not yet find a solution...
After some initial playing around with --prof I found it easier to use Chrome's DevTools. At least for the JavaScript side. DevTools has the advantage of being interactive, and allows you to drill into the underlying .ts code.
Start your app with node's --inspect
flag:
node -r ts-node/register -r tsconfig-paths/register --inspect ./src/index.ts
(Here I'm using ts-node + tsconfig-paths for the typescript handling)
Open chrome://inspect
in Chrome
Under "Remote Target" click "inspect" for your new target
(This should open up a Chrome inspector window connected to your app)
Go to the "Profiler" tab and begin recording a new profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With