Source Code Heatmap
A visualization technique that maps performance sampling results back to source code lines, using color intensity to indicate the sampling hits for each line of code, helping developers locate line-level performance bottlenecks.
Timeline (last 90 days)
A source heatmap aggregates each sampling record by its position in the source code, annotating the number of times each line of code was hit by sampling with color intensity or numeric values, answering which line of code is the most time-consuming, and it requires debug symbols and source maps to restore bytecode instruction positions or line numbers to specific source file lines.
When using a source heatmap, note that line number mappings may be inaccurate after the same function is inlined or optimized; if a single line contains multiple expressions, sampling cannot further distinguish their relative overhead, and the code may need to be manually split for verification.
Recommended workflow: use the 3.15 sampling profiler to collect data, generate a flame graph to locate macroscopic bottlenecks, then use a source heatmap to pinpoint code lines precisely.
The flame graph provided by Simon Willison is presented in HTML form and supports interactive exploration, while the heatmap shows the heat distribution of source code lines in the form of a directory index.
All Facts (4)
A source heatmap aggregates each sampling record by its position in the source code, annotating the number of times each line of code was hit by sampling with color intensity or numeric values, answering which line of code is the most time-consuming, and it requires debug symbols and source maps to restore bytecode instruction positions or line numbers to specific source file lines.
50%UnverifiedWhen using a source heatmap, note that line number mappings may be inaccurate after the same function is inlined or optimized; if a single line contains multiple expressions, sampling cannot further distinguish their relative overhead, and the code may need to be manually split for verification.
50%UnverifiedRecommended workflow: use the 3.15 sampling profiler to collect data, generate a flame graph to locate macroscopic bottlenecks, then use a source heatmap to pinpoint code lines precisely.
50%UnverifiedThe flame graph provided by Simon Willison is presented in HTML form and supports interactive exploration, while the heatmap shows the heat distribution of source code lines in the form of a directory index.
50%