correlate_source_code
Resolve V8 CPU profile hotspots to original TypeScript source lines using source maps, falling back to compiled JS when maps are absent.
Instructions
Maps the hottest functions in a V8 CPU profile back to their original TypeScript source locations using source map files (.js.map). Falls back to compiled JS locations if no source map is found. Use to answer: which TypeScript file and line is the bottleneck actually coming from?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | Number of hottest functions to resolve (default: 10) | |
| profile_path | Yes | Absolute path to the .cpuprofile file | |
| sourcemap_dir | No | Override directory to search for .map files (default: same directory as .js file) |