-
Notifications
You must be signed in to change notification settings - Fork 8.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
Extremely slow performance when processing virtual terminal sequences #10462
Comments
Note that this is a clone of #10362 which was closed by original submitter. As the original bug report was valid it should have been remained open, especially after quite a few suggestions were provided as to how to improve matters. Feel free to reopen original tracking issue and close this duplicate if appropriate. Thank you for the work that you guys do on this project. |
Personally I'd like to also welcome @cmuratori and @mmozeiko back to give any comments if they wish to do so. Of course it'd be entirely understandable if they don't. I believe I can speak for the terminal team, when I say that we want to keep the door to our community open and welcome any civil discourse. I see the comment regarding slow VT parsing again, but I hope you consider that performance of OpenConsole (aka future conhost) has already improved about 4-5x in the last year. With upcoming conhost versions, or the current OpenConsole, you can expect to see a throughput improvement from 4MB/s to about 16-20MB/s for termbench. I know this isn't 270MB/s, but it's a significant improvement regardless, despite keeping all the backwards-compatibility, etc. For instance - referring to the mentioned offenders:
We're now working on improving Here's a flamegraph of OpenConsole for termbench: The render output thread is highlighted in blue. If you have concrete ideas what to improve (and optionally how) to speed up OpenConsole's VT performance further, please let us know and we'll get to it. Promise! Contributions are especially welcome at any time! |
Is there a possibility we (outside of Microsoft) can get some documentation or specification on console driver interface - |
Fair question! We should definitely have some docs on the driver interface, since we're now an open source project that is using an underdocumented OS fixture... Right now the best we have is in the ApiDispatcher and some of the "load bearing code" comments across the codebase. That's not great. I'll see what we can do about that! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To be clear: You are saying this can be the case for just the rendering part, but that it can be slower because of VT processing (Which as I understand it, happens mostly in conhost)? Also, is it possible Alacritty (And all the other terminals you may have tried on windows) are being slowed down by an older version of conhost and slower processing of VT sequences in it than the current OpenConsole? (Possibly making it an unfair comparison) |
@Nicholas-Baron I don’t quite get it what you are asking. I was testing those Linux terminals on barebone Linux machine.
This is not correct. I think you don’t quite know the full picture of ConPTY. VT processing happens in both conhost & Windows Terminal. This is also true with other terminals on Windows that uses ConPTY. If I have to guess the ratio, I’d probably say 60% in conhost and 40% in the terminal? Just a rough guess. Not precise numbers. |
@skyline75489, I think you have the wrong person. |
Yep sorry. On my phone 😅. @nico-abram |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as off-topic.
This comment was marked as off-topic.
We certainly handled the original issue poorly, and we're trying to do better. Casey showed us, with his own particular brand of "showing," that our terminal emulator could be more performant.
We may not have taken the feedback seriously to begin with, but if it appears to have been completely dismissed then I am sorry. Since July, we've begun work on a new renderer implementing the improvements Casey suggested and removed a number of performance bottlenecks along the way (resulting in a ~30% speed improvement for bulk text output and a ~15% speed improvement for VT parsing.) Yes, we move slowly. Whether that is a reasonable cause for community ire is not something I intend to address. To @ndwork's point: the question of "evolution versus revolution" is a worthwhile one to ask. Why do we care so much about keeping what we have and not stopping to rewrite it? I can only answer from my perspective as the engineering lead here.
Unlike other folks, I'm just not in it to kill the old and replace it with the new. That's never been a winning strategy, has it? Everybody else seems like they're rolling out a new rewrite every year, or every two years, that has 20% of the features of the original and the team pretty much shuts down when they hear that users are (quelle surprise!) dissatisfied with their great new thing. I feel like our approach, while slow, is at least measured. Now.
It is the appropriate venue to discuss:
I'm leaving this issue unlocked. Let's work together to keep it on topic! Edit log
|
Thank you for your response. Why were so many comments deleted? It's hard to accept your communal statements when you discard so many of the comments. Indeed, it seems that my comment which you are addressing has been deleted. (Or, I don't really know how to use this messaging board, the comment is there, and I just don't see it.) Perhaps the reason that the code is so difficult to improve is because of the dependencies. Is it the role of the Terminal to improve the console host? Or should Terminal just focus on being an excellent terminal. Which would serve Microsoft better? In my mind, retaining a manageable scope (making a good terminal) has much more valuable than minimally improving Windows by contributing to some massive underlying library.
Based on this idea, Apple would still be using slow Motorolla chips. Instead, they moved to Intel (which Microsoft still uses) and have just recently exceeded Intel's capabilities (for laptops) with their own chips. In my own work, I routinely destroy old codes and replace them with new. By doing so regularly, I never build up too much technical debt. Instead, it's paid off daily, and the codes naturally adapt. Having said that, I'm not a lead of a product at Microsoft used by gazillions; I cannot comment intelligently on your situation. There may be great reasons not to do so; based on the above, I don't understand those reasons. And when one programmer can exceed the performance of a Microsoft product by factors of hundreds with less than two days of programming, I would stare that fear of change in the face, ask exactly what you're afraid of, and is there a way to mitigate that consequence while still achieving. Perhaps limiting the scope of the terminal and eliminating its dependency on the console host is a reasonable approach. I offer the following statement by Isaacson in the biography on Jobs: “One of Job's business rules was to never be afraid of cannibalizing yourself. " If you don't cannibalize yourself, someone else will," he said. So even though an Iphone might cannibalize sales of an IPod, or an IPad might cannibalize sales of a laptop, that did not deter him.” Again, thank you for your response. |
Ah, I minimized the comments above before I locked the thread. They can be expanded with the "Show comment" link at the righthand side for now, but I'll also go through and unminimize some of them. Sorry!
I like that. You're right, of course. These are all really good points for us to think about. 😄 |
Windows Terminal version (or Windows build number)
1.8.1521.0
Other Software
No response
Steps to reproduce
Using any command line utility that produces virtual terminal sequences for setting the colors of individual characters, the performance of the terminal drops by a factor of around 40.
To measure this effect precisely, you can use the F2 key in termbench and observe the performance difference between color-per-character output and single-color output:
https://github.com/cmuratori/termbench/releases/tag/V1
Expected Behavior
Despite the increased parsing load, modern CPUs should not have a problem parsing per-character color escape codes quickly. I would expect the performance of the terminal to be able to sustain roughly the same frame rate with per-character color codes as without, and if there was a performance drop, I wouldn't expect it to be anything close to 40x.
Actual Behavior
The speed of per-character color output is 40x slower than the speed of single-color output.
The text was updated successfully, but these errors were encountered: