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
The initial execution of a Python file is slow again #30
Comments
@joyceerhl has something changed that can explain this. I saw this especially when debugging and @alexr00 saw it as well during testing. See microsoft/vscode#167399 (comment) |
A second run in the same session is more or less instant. |
I was able to repro exactly what Alex saw in Edge, i.e. running a file is fast and debugging right after is very slow on the first try, but subsequently debugging is fast. I even ran |
Not able to repro the slowness at all in Chrome with https://insiders.vscode.dev/github/dbaeumer/python-sample?vscode-coi=. |
@joyceerhl the difference might be that when debugging a lot more Python library files need to be pulled from GitHub than compared to running a Python file. However, I have no explanation why pulling the files needed for debugging should be slow since I assume they should be cached as well (they come from the same GitHub repository). |
I tried various things today to reproduce this but wasn't able to do so. I will keep logging enabled for my testing in case I see this again so that we know more why this could have happened. |
For some reason after refreshing the page I got a slow run and debug. Trace from the Python WASM extension
And here the trace of the remote repository channel Ignore the timestamp difference. I think remote repositories uses UTC and I use local time which is UTC+1. |
What is interesting about the trace is that all stat calls are fast but all readFile calls to @joyceerhl Could it be that some throttling happens. If this can happen even in the load workspace content case could we fin that out in the response header and log it as well. |
Do you happen to have the GitHub Repositories log as well? That log above is for Remote Repositories, and I'm interested in whether we are fulfilling the reads from the tar or from network. |
Actually no. Will capture it the next time |
@joyceerhl here are the two outputs from a slow debug session in the web remote-repository.txt The The content of the |
Yeah, the github-repositories.txt log suggests that this is what happens:
|
@joyceerhl thanks a lot for the investigation. Is there anything I can do here? |
|
Actually, I am actually for option (ii). I do for example load the wasm file into shared memory (and cache it there) so that I don't need to copy it into the worker on every run. Since a sync can happen at any time I would need to drop the WASM file again and reload it into shared memory. For that I would need the event. |
@dbaeumer is copying the wasm file into shared memory still necessary/beneficial if we have shared array buffers and cross origin isolation enabled (I assume so but just want to confirm)? If it is then I'd propose to add readonly onDidSyncRepository: Event<{ repositoryUri: vscode.Uri }>; |
Actually, RemoteHub implements |
@joyceerhl I think it depends on how we handle these buffers now in memory. To my understanding VS Code's FS API still uses no shared buffers (@jrieken need to clarify). As a result the extension still profits from copying the WASM into shared memory since it avoid copying it into the worker over and over again. |
We have no GA for shared memory yet |
I think that's the best, most API'ish, option and it doesn't exclude any future optimisations |
Listening now to the event in version |
Need to investigate why this is happening again.
The text was updated successfully, but these errors were encountered: