Skip to content

Conversation

@lkollar
Copy link
Contributor

@lkollar lkollar commented Dec 15, 2025

Add a visualisation explaining how the sampling profiler works.

image

CC: @pablogsal


📚 Documentation preview 📚: https://cpython-previews--142772.org.readthedocs.build/

Add an interactive JS visualisation to demonstrate how the sampling
profiler works. A small demo program is shown executing line by line,
demonstrating how stack frames are created and destroyed and how samples
are taken periodically during the process.

A new Sphinx extension is used to capture and inject the trace into the
JS file during documentation build to make these traces reproducible
(and avoid hard coding them in the source code).
.. only:: html

The following interactive visualization demonstrates how sampling profiling
works. Press **Play** to watch a Python program execute, and observe how the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the :guilabel: role for buttons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants