-
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
Add an automated conhost benchmark tool #16453
Conversation
I'll leave this PR in draft until next year when we're under less time-to-ship-urgency. Since it's just a tool it's not important to review and/or merge it in anyways after all. |
The latest commit should fix that issue. The old code did effectively The new code is a bit simpler (hopefully), but it also includes a better way to track time limits, etc. It should be a bit more robust now. It can still randomly hang though, until we merge #16457 (just press Ctrl+C if that happens and repeat it). There can also be quite some variation for the |
conhost has 2 bugs related to clipboard handling: * Missing retry on `OpenClipboard`: When copying to the clipboard explorer.exe is very eager to open the clipboard and peek into it. I'm not sure why it happens, but I can see `CFSDropTarget` in the call stack. It uses COM RPC and so this takes ~20ms every time. That breaks conhost's clipboard randomly during `ConsoleBench`. During non-benchmarks I expect this to break during RDP. * Missing null-terminator check during paste: `CF_UNICODETEXT` is documented to be a null-terminated string, which conhost v2 failed to handle as it relied entirely on `GlobalSize`. Additionally, this changeset simplifies the `HGLOBAL` code slightly by adding `_copyToClipboard` to abstract it away. ## Validation Steps Performed * `ConsoleBench` (#16453) doesn't fail randomly anymore ✅
conhost has 2 bugs related to clipboard handling: * Missing retry on `OpenClipboard`: When copying to the clipboard explorer.exe is very eager to open the clipboard and peek into it. I'm not sure why it happens, but I can see `CFSDropTarget` in the call stack. It uses COM RPC and so this takes ~20ms every time. That breaks conhost's clipboard randomly during `ConsoleBench`. During non-benchmarks I expect this to break during RDP. * Missing null-terminator check during paste: `CF_UNICODETEXT` is documented to be a null-terminated string, which conhost v2 failed to handle as it relied entirely on `GlobalSize`. Additionally, this changeset simplifies the `HGLOBAL` code slightly by adding `_copyToClipboard` to abstract it away. * `ConsoleBench` (#16453) doesn't fail randomly anymore ✅ (cherry picked from commit 86c30bd)
conhost has 2 bugs related to clipboard handling: * Missing retry on `OpenClipboard`: When copying to the clipboard explorer.exe is very eager to open the clipboard and peek into it. I'm not sure why it happens, but I can see `CFSDropTarget` in the call stack. It uses COM RPC and so this takes ~20ms every time. That breaks conhost's clipboard randomly during `ConsoleBench`. During non-benchmarks I expect this to break during RDP. * Missing null-terminator check during paste: `CF_UNICODETEXT` is documented to be a null-terminated string, which conhost v2 failed to handle as it relied entirely on `GlobalSize`. Additionally, this changeset simplifies the `HGLOBAL` code slightly by adding `_copyToClipboard` to abstract it away. * `ConsoleBench` (#16453) doesn't fail randomly anymore ✅ (cherry picked from commit 86c30bd)
OpenConsole.sln
Outdated
@@ -2806,6 +2808,30 @@ Global | |||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|ARM64.ActiveCfg = Release|ARM64 | |||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|x64.ActiveCfg = Release|x64 | |||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|x86.ActiveCfg = Release|Win32 | |||
{BE92101C-04F8-48DA-99F0-E1F4F1D2DC48}.AuditMode|Any CPU.ActiveCfg = Debug|Win32 | |||
{BE92101C-04F8-48DA-99F0-E1F4F1D2DC48}.AuditMode|ARM.ActiveCfg = Debug|Win32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now you gotta drop all the ARM lines from this file!
I use vim:
:g/\<ARM\>/d
:wq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is so cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh man we so should run this and publish these as a CI artifact. that'd be neat
ConsoleBench
is capable of launching conhost instances and measuringtheir performance characteristics. It writes these out as an HTML file
with violin graphs (using plotly.js) for easy comparison.
Currently, only a small number of tests have been added, but the code
is structured in such a way that more tests can be added easily.