Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step over and Step in are quite slow #127720

Closed
lramos15 opened this issue Jun 30, 2021 · 9 comments
Closed

Step over and Step in are quite slow #127720

lramos15 opened this issue Jun 30, 2021 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders notebook verified Verification succeeded
Milestone

Comments

@lramos15
Copy link
Member

Testing #127362

  1. Start debugging jupyter notebook
  2. Step over a variable definition
  3. 🐛 The entire watch variables flashes and it takes a solid second before the next line is hit
@rchiodo rchiodo removed their assignment Jun 30, 2021
@DavidKutu DavidKutu self-assigned this Jun 30, 2021
@roblourens
Copy link
Member

I can confirm that step over is much slower than it was earlier

@DavidKutu
Copy link

I see it too, maybe its related to the timer and spinner fix?

@DavidKutu DavidKutu transferred this issue from microsoft/vscode-jupyter Jun 30, 2021
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug notebook labels Jun 30, 2021
@roblourens
Copy link
Member

roblourens commented Jun 30, 2021

Hey @isidorn, I have this code to update some notebook metadata based on the current debug state, but it slows things down by generating too many callstack requests, and I don't know how to do this the right way

private async onDidChangeCallStack(): Promise<void> {

I think one problem is that we might call fetchCallStack when a request has already been sent by CallStackView. If a request is already in flight, I want to wait on that request instead of triggering a new one.

And I have to call fetch, because otherwise the callstack is empty when the onDidChangeCallStack is fired. If I don't call fetch, then I get the event 3 times for each step with an empty callstack. But I think this generates a lot of load. I guess it is faster in the callstack because it debounces updates and requests just one frame first?

image

(There are 4 threads)

So it's not clear to me how to do this efficiently.

@isidorn
Copy link
Contributor

isidorn commented Jul 1, 2021

@roblourens so you just want to be called every time the call stack changes, but that the stackFrames are all fetched correct?
So if we fetch stackFrames by first getting the top one, and only then the rest, you just want to be called one time once everything is fetched?
Let's first clarify that.

We might need to introduce a new event onDidReceiveCallStack or something like that

You should not need to call fetchCallStack that is a bit internal.

@roblourens
Copy link
Member

I don't think I want to ask for all stackframes every time, because currently you don't actually request all stackframes unless the callstack is visible and the user clicks "Load more", right? And I don't want to cause more load. I think I just want to be notified when the top 20 frames are available.

@isidorn
Copy link
Contributor

isidorn commented Jul 1, 2021

Yeah, we only request all the stack frames once the user clicks on the "Load more".
I think we should introduce a new event for this, as there does not seem to be the exact one you need. New event could maybe live somewhere here https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/debug/browser/debugSession.ts#L859
onDidFetchThreadCallStack and would send out a thread

Alternatively maybe you could listen on debugService change state, and when you see that it is stopped you can ask for the full stack frame and this should work I think. However state changes also when the user focuses other sessions so it would not be completely precise.

@roblourens
Copy link
Member

I just disabled the whole thing for now. To verify, stepping in a notebook cell should not feel extremely slow.

@lramos15 lramos15 added the verified Verification succeeded label Jul 7, 2021
@lramos15
Copy link
Member Author

lramos15 commented Jul 7, 2021

Still much slower than say a typescript file, but faster than before.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders notebook verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants
@roblourens @isidorn @lramos15 @rchiodo @DavidKutu and others