HNHacker News
TopNewBestAskShowJobs

p403n1x87

359 karma · joined December 21, 2019

submissionscomments
p403n1x87··on Austin 4 Released
I am delighted to announce the 4.0 release of Austin. If you haven't heard of Austin before, it is an open-source out-of-process frame stack sampler for CPython, distributed under the GPLv3 license. It can be used to obtain statistical profiling data for a running Python application with no manual instrumentation and virtually zero impact on the runtime. You can find the code at

https://github.com/P403n1x87/austin

The main highlights of the new release are the support for Python 3.14, as well as many substantial performance improvements that make Austin one of the most accurate sampling profilers for CPython. More details about what's new and bug-fixes can be found in the changelog at

https://github.com/P403n1x87/austin/blob/master/ChangeLog

Installing Austin is as easy as running

pip install austin-dist

on any supported combination of architecture and platform. More installation options are available in the README file from the GitHub repository, along with usage details, as well as some examples of Austin in action. Details on how to contribute to Austin's development can be found at the bottom of the page.

As for ways of using Austin, the Austin VS Code extension provides a smooth interactive profiling experience, with interactive flame graphs straight into the text editor to allow you to quickly jump to the source code with a simple click. You can find the extension on the Visual Studio Marketplace and install it directly from VS Code:

https://marketplace.visualstudio.com/items?itemName=p403n1x8...

An Austin docker image, based on the latest Ubuntu image, is also available from Docker Hub:

https://hub.docker.com/r/p403n1x87/austin

Austin is a free and open-source project. A lot of effort goes into its development to ensure the best performance and that it stays up-to-date with the latest Python releases. If you find it useful, consider sponsoring this project on GitHub at https://github.com/sponsors/P403n1x87.

p403n1x87··on Austin 3.7 – Python frame stack sampler for CPython
This latest release comes with support for CPython 3.13
p403n1x87··on Memray – A Memory Profiler for Python
It is still in experimental stages, but would you be willing to test the memory mode of Echion? (https://github.com/P403n1x87/echion). It is essentially tracing of all memory allocations. Mind that, if an allocation is followed by a matching de-allocation, it won't be reported; so if you profile from start till end, and all the memory is released, the profile should be almost empty (in reality this will almost never be the case); this might explain why the data doesn't seem to make sense from the tools you have tried already (assuming they do a similar thing).
p403n1x87··on Spasmlang: Simple Python Assembly Language
https://www.dictionary.com/browse/spasm
p403n1x87··on Flameshow: A terminal flamegraph viewer
There is a "live" flamegraph TUI that uses Austin for those interested in Python profiling https://github.com/P403n1x87/austin-tui. The data collected can be exported and then converted into pprof, and analysed further with flameshow etc...
p403n1x87··on Pystack: Like Pstack but for Python
This seems to be heavily based on Austin https://github.com/P403n1x87/austin/blob/master/src/version.... https://github.com/bloomberg/pystack/blob/a971a4ced371a5859f...
p403n1x87··on Austin Is Now on PyPI
The Austin binary can now be installed from PyPI with pip/pipx on all supported platforms and architectures
p403n1x87··on Fine-grained statistical profiling for CPython
The latest 3.5 release of Austin brings support for column-level location information exposed by CPython 3.11, which makes it the first statistical profiler for CPython to provide timing information to the finer-grained expression level.
p403n1x87··on Memray: a memory profiler for Python
This should work with anything https://github.com/P403n1x87/austin
p403n1x87··on Memray: a memory profiler for Python
Hmm some elements of that TUI look vaguely familiar ... where have I seen them before?
p403n1x87··on Running C unit tests with Pytest
That's a good argument for keeping these kind of tests separate. Indeed Austin has dedicated Valgrind integration tests just for this reason.
p403n1x87··on Running C unit tests with Pytest
That's a good observation. Towards the end the fixture is dropped in favour of a module-like object, which spaws the compiler once per test run. One could enhance this to skip compilation in the sandbox process to avoid unnecessary compilations.
p403n1x87··on Pyheatmagic: Profile and view your Python code as a heat map
Austin can make heat maps in VS Code :) https://marketplace.visualstudio.com/items?itemName=p403n1x8...
p403n1x87··on Spy on Python down to the Linux kernel level
Cheers!

I have now released v1.0.0 of the TUI. The pip command requires an option to install pre-releases and that's why it was probably installing the old 0.2.0 version.

As for the async profiles, I'd not expect the event loop own time to be on CPU, so using the -s option to collect only on-CPU samples should filter the event loop own time out.

p403n1x87··on Spy on Python down to the Linux kernel level
Thanks for reporting this. Do you mean an async tracee? Austin(p) handles all sorts of Python code, so should work with async like any other code.
p403n1x87··on Spy on Python down to the Linux kernel level
If you follow the call stack carefully you should be able to get to the point where sklearn calls ddot_kernel_8 (indirectly in this case). Austin(p) reports source files as well, so that shouldn't be a problem (provided all the debug symbols are available). If you're collecting data with austinp, don't forget to resolve symbol names with the resolve.py utility (https://github.com/P403n1x87/austin/blob/devel/utils/resolve..., see the README for more details: https://github.com/P403n1x87/austin/blob/devel/utils/resolve...)
p403n1x87··on Spy on Python down to the Linux kernel level
You'd normally look at a more convenient visualisation of this data, usually in the form of a flame graph, which shows you aggregated figures for functions and the actual call stacks. If you don't care much about %'s you could still learn a lot about how a program works (especially if you're not familiar with it) just by looking at the call stacks. The VS Code extension makes this quite easy to do since you can click on the interactive flame graph to hop directly to the source code and peek around. See for example https://p403n1x87.github.io/how-to-bust-python-performance-i..., which en passant shows you how pytest works internally
p403n1x87··on Show HN: Austin VS Code – Interactive Python Profiling in VS Code
Make sure you have Austin (https://github.com/P403n1x87/austin) installed.

See https://p403n1x87.github.io/how-to-bust-python-performance-i... for an example.

p403n1x87··on The Mathematical Foundations of Machine Learning
This book is a mathematical cross-section of the fundamentals of modern Machine Learning. The main ideas behind the three main paradigms of ML (Supervised, Unsupervised and Reinforcement Learning) are analysed from the perspective of the underlying mathematical theory that justifies their successes in state-of-the-art applications. All the results are rigorously proven, and references are given where appropriate, to help build up a bag of theoretical tools for the ML practitioner.
p403n1x87··on [dead]
I am delighted to announce the release 2.1.1 of Austin, an open-source frame stack sampler for CPython. It can be used to obtain statistical profiling data out of a running Python application without a single line of instrumentation. This means that you can start profiling a Python application straight away, even while it's running on a production environment, with minimal impact on performance.

The simplest way of using Austin is by piping its output to FlameGraph or uploading it to speedscope.app for a quick and neat visualisation of the collected samples.

Austin can be installed easily on the following platforms and from the following sources:

Linux: - Snap Store - Debian repositories - Conda Forge

macOS: - Homebrew - Conda Forge

Windows: - Chocolatey - Scoop

Austin is also simple to compile from sources as it only depends on the standard C library, if you don't have access to the above-listed repositories.

This new release of Austin brings enhanced support for many Python binary distributions across all the supported platforms, as well as a bugfix for the line number reporting. If you rely on Austin 2, upgrading to the latest version is strongly recommended.

Let me also remind you of some of the other existing Python tools powered by Austin, which have also seen new releases in the past few days, and that are easily available from PyPI:

https://github.com/P403n1x87/austin-tui https://github.com/P403n1x87/austin-web https://github.com/P403n1x87/pytest-austin

These tools are built using the austin-python library, which is also available from PyPI, with source code hosted at

https://github.com/P403n1x87/austin-python

For anyone wishing to build their own Austin-powered tools, the austin-python documentation is hosted on RTD at

https://austin-python.readthedocs.io/en/latest/

Follow Austin on Twitter (https://twitter.com/AustinSampler).

p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
That should work
p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
true that
p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
Ah! Totally a typo, thanks for that :)
p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
yep :)
p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
Running Python is not a performance cost. The meaning behind "no performance cost" is that a tool like this is unlikely going to impact the performance of the application that is being profiled. The fact that Python is not a "fast" programming language is then a different matter.
p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
I wrote a blog post about the technology behind the TUI

https://p403n1x87.github.io/the-austin-tui-way-to-resourcefu...

It's a custom resource-based framework that uses curses as back-end.

p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
For these kind of things one could use

https://github.com/P403n1x87/austin-python

An early attempt at an APM that was specifically designed to measure endpoint response times was here

https://github.com/P403n1x87/austin/blob/apm/austin/apm.py

The problem with statistical profilers is that they might fail to catch every single call, especially when they are fast.

p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
One benefit of Austin-based tools is that they don't require any instrumentation/extra configuration. The low overhead means that you can just attach to an application that is running in production.
p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
All good points. The "no performance cost" is indeed more like "negligible performance costs". That's because these days multicore architectures are quite ubiquitous and standard Python applications are single process. For multi-process Python applications, a busy profiler would certainly steal a good chunk of a core, so the impact might be noticeable in that case.

As for the race conditions, Austin does not introduce any pauses. Even if it did, there would be no guarantee that it paused at a "good" point, so there are no real benefits in terms of accuracy in pausing. Error rates are quite low anyway, so the actual benefit comes from not pausing at all.

p403n1x87··on Show HN: Austin-Tui – Spy inside a running Python program at no performance cost
as easy as profiling with Austin itself. Just pass the pid of the web server

sudo austin-tui -Cp <webserverpid>

See https://github.com/P403n1x87/austin#examples for more details. To avoid using sudo on Linux you can do

sudo setcap cap_sys_ptrace+ep `which austin`

and then simply

austin-tui -Cp <webserverpid>

Page 1 of 2Next →