Sourcemap Support
Utilizing typescript and/or transpilers with N|Solid makes interpreting CPU profiles difficult unless the user is deeply familiar with the code. The integration of Source Maps provides a translation layer that provides a reference between the compiled source code and source code.
When compiling code, a Source Map is currently being generated. The integration of Source Maps provides a translation layer that provides a reference between the compiled source code and source code.
In an effort to address concrete customer pain-points, NodeSource has introduced SourceMap Support to the N|Solid CPU profiler. This feature continues to evolve with the specific requirements of our customers. NodeSource therefore envisages a phased rollout.
Currently the feature can be accessed as follows:
- The NSolid Console backend assumes that the sourcemap is right next to the file, i.e.
foo.js.map
, which it subsequently reads and sends that to the client. - When opening the Flamegraph view, ensure the Sourcemap-Box is checked.
- This makes the client traverse the CPU profile and request a sourcemap for all function locations from the Console backend
- The Client then uses the updated CPU profile to generate a flamegraph.
- If the Sourcemap box is unchecked, the original CPU profile is used again.
- Stored asset of the Profile includes a ourcemap setting and applies it when the asset is loaded again.