Austin VS Code Extension
Profile and analyse your Python application inside VS Code using Austin.
This extension requires Austin 3. See Austin for installation instructions for your platform. If you want to compile from sources or use one of the available release binaries, you can specify the absolute location of the Austin binary in the settings.
There are two ways of executing Austin from VS Code. Either using a configured task, or a one-off execution.
Profiling with tasks
The Austin extension provides a
You can also specify a list of arguments to send to your Python script.
This is equivalent of running
To Run the task, execute
If you need to run a more generic command, for example by invoking a virtual
environment manager like Poetry, you can use the
In the above task definition, the Austin command is placed in between the
from the current working directory.
Tasks also support the use of the placeholders
Profiling a standalone script
To profile a Python script, open it up in VS Code, open the command palette and
The flame graph is interactive and when you click on a frame, the corresponding source will be opened (assuming that all the paths can be resolved correctly) in VS Code and lines highlighted based on the amount of time spent on them.
To search through an open flame graph, press F and type a search string. To reset the view, simply press R. Conveniently, you can bring up the open dialog with O while the focus is on the flame graph panel.
The extension also adds two interactive tree views in the side bar to explore the sampled call stack and the top functions. Click on the Austin logo in the activity bar to reveal them.
Expression-level heat maps
To enable support for column-level location information, ensure that the Austin extension is set up to use the binary mode in the extension settings. Note that this requires at least the version 3.5 of Austin to work. Binary mode itself only requires Austin 3.4 to work. Earlier Austin versions don't support binary mode and the extension won't work if in binary mode.
Whenever you have an active Python script, the sampling interval and mode selector will appear on the status bar. Select between wall-clock time and CPU time sampling, and the sampling interval in microseconds.