Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Reported slowness due in variable expansion

Open
#1,660 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

The issue names no file, test, or reproducible case. Start by tracing how debugpy handles variable presentation and expansion for very large values, then compare that behavior with the DAP lazy and indexedVariables mechanisms described here. Done means large variables no longer block debugger interaction or overwhelm clients.

Written by the indexing model from the issue text.

Description

bug needs repro

Isidor pointed out a tweet that mentions

S Code’s debugger would lock up whenever I stepped past a line like: S=tensor.untyped_storage()... the debugger window that automatically displays local variables started a dump of over a billion elements from the debug server before it would process any other commands.

I have not attempted to repro myself, but there are a few ways in the debug protocol that cases like this can be handled:

  • Set lazy: true on the VariablePresentationHints of potentially expensive variables so that they aren't expanded without user action
  • Use indexedVariables to allow the client to request a small number of a variable's contained data and page through it

Even if it's unavoidable that a giant variable's data is loaded into the debug adapter, it should use these mechanisms to avoid overloading clients and slowing down interaction on the protocol.

Let me know if there's anything I can help with from the VS Code side :)

Dominant language
Python
Stars
2.5k
Forks
202
Avg merge
5d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/debugpy

All issues in microsoft/debugpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.