Soft Forge Perf Analyser
See where your program spends its time, without leaving the editor.
Perf Analyser turns the profiles you record with perf and py-spy into a heatmap over your own code. Every source line shows its share of the samples, the hottest line of a file or of the whole workspace is one command away, and an interactive flame graph shows the shape of the calls behind the numbers. Record, open the project, and the answer is already on the lines that matter.
What it does for you
- The cost of every line, in place. Each line is tinted by its share of the samples and annotated with the percentage, the count, or both. Lines under a threshold you choose stay quiet.
- Straight to the hot spot. Go to Hottest Line opens the line with the most samples, in the current file or across the workspace.
- Always the latest profile. Perf Analyser finds
perf.data in your project, converts it and loads it by itself, and reloads it each time you record again. Your editor follows your measurements without a single extra step.
- One view per event. Pick the event to look at (cycles, cache misses, any event you recorded) and the heatmap and the flame graph follow.
- Profiles from elsewhere. A profile recorded on a build server or another machine lands on your local files, by itself when the project layout matches, or through a path mapping you set once.
- An interactive flame graph. Zoom into any frame, filter by symbol and see what share of the time matches, open the source line of a frame with Shift+click, and step back through the zoom path. The panel follows your editor theme and refreshes when the profile changes.
Free and Pro
|
Free |
Pro |
Load perf and py-spy profiles, load and reload perf.data by itself |
✓ |
✓ |
| Line heatmaps and annotations, per event |
✓ |
✓ |
| Go to the hottest line of the file or the workspace |
✓ |
✓ |
| Path mappings for profiles recorded on another machine |
✓ |
✓ |
| The interactive flame graph: zoom, symbol filter, click to the source |
Trial |
✓ |
The trial is 60 minutes of Pro, once per installation, with no account. It starts only when you ask for it: opening the flame graph does not start it. After it, an installation without a plan stays on the Free plan: the flame graph panel says what it needs and offers the ways to unlock it, and nothing else changes.
Your plan shows in the status bar. Click it for the subscription menu: sign in with your Soft Forge account, start the trial, see plans or enter a license key. See Plans and Manage Subscription open your client portal, where plans, bills and devices are. A paid installation keeps working through periods offline.
Profiling with perf
Record a profile with call graphs:
perf record --call-graph dwarf ./my_program --some-arg < some_input
-e picks the event (perf list shows them), -F the sampling frequency; see man perf-record.
Open the project. Perf Analyser finds perf.data, writes perf.out beside it and annotates your code, with a progress notification you can cancel. To do this by hand, set perfAnalyser.autoLoad to false and run Perf Analyser: Auto Load perf.data, or load a report you made yourself with Perf Analyser: Read perf Report:
perf report -g folded,0,caller,srcline,branch,count --no-children --full-source-path --stdio -i perf.data > perf.out
Record again: the annotations follow one second after perf.data changes (perfAnalyser.autoReload).
If perf.data was recorded at a higher rate than your system allows, a warning offers to open a terminal with the sysctl command that raises the limit.
Profiling with py-spy
Record with the raw format and full file names:
py-spy record --full-filenames --idle --rate 198 --format raw -o pyspy.txt -- python my_script.py
Run Perf Analyser: Read py-spy File and pick the file. The choice is remembered for the workspace (perfAnalyser.pyspyFile).
The flame graph
Perf Analyser: Show Flame Graph opens the panel beside the editor.
- Toolbar: the event, a symbol filter (matching frames stay bright, the rest dim, and the toolbar says what share of the samples matched), the sample and frame counts, Reset zoom, Hottest line and your plan; click the plan for the subscription menu.
- Breadcrumb: the zoom path; each step takes you back to that frame.
- Graph: the width of a frame is its share of the samples, its colour the heat, from cold to hot. Click a frame to zoom into it, Shift+click to open its source line, hover for the file, line, count and share.
Esc clears the filter, then the zoom.
- Footer: the selected frame with its location and share, and the heat legend.
Commands
| Command |
What it does |
| Perf Analyser: Auto Load perf.data |
Finds perf.data, converts it and loads it. |
| Perf Analyser: Read perf Report |
Loads a perf report file. |
| Perf Analyser: Read py-spy File |
Loads a py-spy raw file. |
| Perf Analyser: Pick Event |
Chooses the event to show. |
| Perf Analyser: Go to Hottest Line (Current File) / (Workspace) |
Opens the line with the most samples. |
| Perf Analyser: Show Flame Graph |
Opens the flame graph panel (Pro). |
| Perf Analyser: Clear Highlights |
Removes every annotation. |
| Perf Analyser: Clear Stored Report Paths |
Forgets the remembered profile files. |
| Perf Analyser: Highlight Current Line |
Highlights the line under the cursor. |
| Perf Analyser: Subscription…, Sign In, Sign Out, Start Trial, See Plans, Manage Subscription, Enter License Key…, Remove License Key, Check Subscription Now |
Your subscription. |
Settings
| Setting |
Default |
What it does |
perfAnalyser.eventOutputType |
percentage |
The annotation: count, percentage or percentage and count. |
perfAnalyser.localRelative |
false |
Counts relative to the enclosing symbol. |
perfAnalyser.highlightColor |
#FF0000 |
The heatmap colour; also the hot end of the flame graph. |
perfAnalyser.minimumThreshold |
0 |
Lines below this share (0.0 to 1.0) are not annotated. |
perfAnalyser.perfFile, perfAnalyser.pyspyFile |
|
The remembered profile files, relative to the workspace. |
perfAnalyser.onlyLocalLeaf |
false |
Keeps, for each sample, only the deepest frame inside your workspace. |
perfAnalyser.pathMappings |
{} |
Maps the source paths recorded in a profile to your local ones, for example { "/build/project": "${workspaceFolder}" }. |
perfAnalyser.autoLoad, perfAnalyser.autoReload |
true |
Load perf.data when the editor opens the project, and reload it when it changes. |
perfAnalyser.license.statusBar |
true |
Show the subscription in the status bar. |
License
Soft Forge Perf Analyser is proprietary software of Soft Forge, used under the Free plan, the trial and the paid plans above. Parts of it derive from open-source projects; their notices ship with the extension in THIRD-PARTY-NOTICES.md.
| |