-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Compiling VSCode project substantially faster with Status Bar and Panel hidden #160118
Comments
Couple notes:
|
does changing |
With panel open (edited same file each run):
With panel closed:
The only thing printed to Terminal until build completed is:
|
Thanks for investigating and for all of the info. What's interesting to me is that the data gets parsed regardless of the panel's visibility and yet that Seems like we need to find out which other actions are counted in that parse.mov |
on mac, I can't see a noticeable slowdown |
/duplicate #155134 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines. Happy Coding! |
Actually let's track the OOM crash in #155134 and the command duration here. |
This is actually as designed, what's happening here is both data parsing and rendering is on the same main thread, data parsing consumes as much time as will fit in ~16ms before triggering an animation frame. The animation frame then performs the render which also runs on the main thread and takes time away from the parsing. It's a little unclear what's most correct here but how it is currently is the renderer is optimized for high FPS, smoothness and responsiveness. We could for example cap the FPS rate when the terminal is getting flooded like this which would increase parsing speed, but then people would complain about the opposite of FPS drops. Another idea we've tossed around is running the parser (or renderer?) in a different thread which is probably more work than it's worth tbh. Let's move this discussion to xtermjs/xterm.js#4135 |
I appreciate you looking into it. I'm not sure if I misunderstand you but nothing is output to the terminal during build which is why I filed the bug. To better demonstrate the problem, here's some code that generates a file with 48,000 lines of typescript to compile. It does not emit anything to console:
Here's the tsconfig.json used to build the file:
Building it with panel open:
Building it with panel closed:
Note the memory usage is the same (it's not OOM). There's no buffer to flush to the console so it shouldn't be animation frame / rendering issue unless it doesn't return immediately when there's nothing to do. And "Check time" takes majority of time when the panel is open (19.30s vs 3.56s when closed). |
I ran the performance profiler during the build. It appears the terminal isn't ignoring the empty buffer and instead is resizing/reflowing the terminal as if it's being flooded with data. I'm not familiar with how it works internally but it appears it's running the entire routine even if there's nothing in the output buffer. |
thanks for the info. let us know if it's not fixed in insider's today /duplicate #161758 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines. Happy Coding! |
Doesn't appear to be fixed. The build time in code-insider is 31.83s (panel open) and 15.80s (panel closed).
|
Yeah I actually realized this is not related to that issue at all because there is no output |
So I ran two performance profiles running on code-insiders. One with panel open and other with panel closed. Hope they help Profile-20220927T120823-panel-open.json.txt took 29.14s Profile-20220927T121903-panel-closed.json.txt took 18.71s |
Hmm I don't see much terminal related calls in the panel open profile but quite a bit of menu/view pane related stuff. I wonder if this also happens when you run something but open up a different view (output?) in the panel. |
The timing is no different when OUTPUT tab focused during build |
Hi, little update: today I realized you must hide both the status bar and the Panel for the significant compile time speed up. |
Any chance that anyone is looking into this? |
Could the issue be in typescript itself? It sounds like it's sending terminal control messages to the terminal. Maybe this takes a different amount of time if Status Bar and Panel are closed. As it's not emitting any diagnostics this should only happen once, it shouldn't take 15 seconds! In |
To recreate, you must hide the two items highlighted below for compilation speed increase:
Both of these must be hidden or you will not be able to recreate (@meganrogge video shows the STATUS BAR open when when failing to reproduce the speed increase). A couple months ago I had the status bar open and builds were slow again. It was then I realized that both must be hidden to reproduce so I updated the bug report. |
It's likely in how status messages are being handled as both panels show an animation when a project is compiling |
We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our issue reporting guidelines might help you with that. Happy Coding! |
(edited to add both the STATUS BAR and PANEL must be hidden for speed increase)
I recently noticed that my project builds substantially faster with the Panel and Status Bar hidden. I hid the Panel the other day and noticed a huge performance increase. I pretty much use default tsconfig.json configuration. Wondering if anyone else can recreate?
Timing with panel open: 19.86s
Timing with panel closed: 4.60s
It appears the Parse Time, Bind Time and Check Time are much faster with Panel and Status Bar closed.
The steps I use to build:
tasks.json
Output of --extendedDiagnostics with Panel open (edited same file to recreate build):
When Panel closed:
The text was updated successfully, but these errors were encountered: