Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-146256: Add--jsonl flag to theprofiling.sampling#146257

Draft
maurycy wants to merge 3 commits intopython:mainfrom
maurycy:tachyon-ndjson-kolektor
Draft

gh-146256: Add--jsonl flag to theprofiling.sampling#146257
maurycy wants to merge 3 commits intopython:mainfrom
maurycy:tachyon-ndjson-kolektor

Conversation

@maurycy
Copy link
Contributor

@maurycymaurycy commentedMar 21, 2026
edited
Loading

This PR adds--jsonl discussed in#146256.

It's a draft - it does not contain tests yet. The class is below 2**8 lines of code and does not touch existingprofiling.sampling code, so I took a leap. I'm already uncomfortable with creating a PR for an issue that wasn't widely discussed. I don't want to clutter it with tests, until the format is solidified.

For example:

sudo -E \  uv run \    --python /Users/maurycy/src/github.com/maurycy/cpython/python.exe \      python \        -m profiling.sampling \           run \             --jsonl \             -o /tmp/profile.jsonl /tmp/hello_world.py

Where/tmp/hello_world.py could be:

importtimeprint("Hello, World!")time.sleep(0.1)

Given the similarity, the class just inherits fromStackTraceCollector. (I think this is a good hint that the collectors should be separate from renderers.)

Visual Studio Code Extension

For the purpose of demonstrating the--jsonl usefulness,I have vibe-coded (with Claude Code) a simple VSCode Extension that leverages this play profile and displays it in the editor:

image

I think that, once we have--stream it will be much more exciting.

Apart from headless profilers:updating the real-time hot spots from the production in VSCode, or, well, making agents' life easier.

You can fetch the vibe-coded VSCode Extension here (no guarantees):

Or:

mkdir -p~/.vscode/extensions/profiling-heatmap                                                                                                                                                                                   curl -sL'https://gist.githubusercontent.com/maurycy/50a80586636a90216efc86065bbfd6de/raw/719e46f4f086c819edbbee7b20c45c41eae15e8b/extension.js' -o~/.vscode/extensions/profiling-heatmap/extension.js                           curl -sL'https://gist.githubusercontent.com/maurycy/fa4c3acd9e8e681a609bddc9ad04c4ae/raw/1edd3c2716a4a9e55aba8ed94850fd70f61fa606/package.json' -o~/.vscode/extensions/profiling-heatmap/package.jsonecho"Restart VSCode, then: Cmd+Shift+P -> 'Profiling: Load JSONL Profile'"

Please do not forget about removing~/.vscode/extensions/profiling-heatmap/ after tests.

@maurycymaurycy marked this pull request as draftMarch 21, 2026 16:00
@maurycymaurycy changed the titlegh-146256: Add--ndjson flag to theprofiling.samplinggh-146256: Add--jsonl flag to theprofiling.samplingMar 21, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@maurycy

[8]ページ先頭

©2009-2026 Movatter.jp