Performance regression for Conhostv2 wrapped by ConEmu #1073

Closed
opened 2026-01-30 22:15:48 +00:00 by claunia · 1 comment
Owner

Originally created by @miniksa on GitHub (May 14, 2019).

Ported from internal issue.

Repro Steps:
APIs that need to be further diagnosed by severity:

ReadConsoleOutputString - 24ms legacy, 442ms modern
FillConsoleOutput - 15ms legacy, 293ms modern
ReadConsoleOutput - 15ms legacy, 122ms modern

Maybe?
SetConsoleScreenBufferSize - 3ms legacy, 51ms modern

conhost.exe module is stamped 10.0.18345.1 which is one of the 19h1_release candidate builds.

Discussion:
@miniksa on Feb 26:
It appears that ConEmu is bulk reading a massive amount of state from the existing console host session before allowing things to proceed, probably synchronizing itself with the window it's wrapping.

We appear to have made that bulk read worse in recent days. We should institute performance tests with our new perf framework for these APIs and then work to optimize them back down

@miniksa on Mar 1:
OK. I've made a performance test for ReadConsoleOutputAttribute.

For v2 console, reading 9999 lines of ReadConsoleOutputAttribute appears to take ~3900ms.

For v1 console, the same takes ~300ms.

The goal now is to bring the time down.

@miniksa on Mar 1:
Sorry, that's a bad comparison. I was using debug code for v2.

This is release code comparison:

V2: ~400ms
V1: ~300ms

That's not that bad...

@miniksa on Mar 1:
OK I investigated the actual buffer dimensions and parameters used by ConEmu (81 wide x 32766 tall buffer) and reading 99 rows at a time worth of attribute data.

The new metrics for the closer matching test are:
v1 = 20-50ms
v2 = 130-170ms

@miniksa on Mar 1:
I made one for FillConsoleOutputAttribute too. Same dimensions.

v1 is 20-40ms

v2 is 120msish

@miniksa on Mar 1:
Added a third and final test for ReadConsoleOutputW and it seems to just straight up match the v1 perf.

Originally created by @miniksa on GitHub (May 14, 2019). Ported from internal issue. Repro Steps: APIs that need to be further diagnosed by severity: ReadConsoleOutputString - 24ms legacy, 442ms modern FillConsoleOutput - 15ms legacy, 293ms modern ReadConsoleOutput - 15ms legacy, 122ms modern Maybe? SetConsoleScreenBufferSize - 3ms legacy, 51ms modern conhost.exe module is stamped 10.0.18345.1 which is one of the 19h1_release candidate builds. Discussion: @miniksa on Feb 26: It appears that ConEmu is bulk reading a massive amount of state from the existing console host session before allowing things to proceed, probably synchronizing itself with the window it's wrapping. We appear to have made that bulk read worse in recent days. We should institute performance tests with our new perf framework for these APIs and then work to optimize them back down @miniksa on Mar 1: OK. I've made a performance test for ReadConsoleOutputAttribute. For v2 console, reading 9999 lines of ReadConsoleOutputAttribute appears to take ~3900ms. For v1 console, the same takes ~300ms. The goal now is to bring the time down. @miniksa on Mar 1: Sorry, that's a bad comparison. I was using debug code for v2. This is release code comparison: V2: ~400ms V1: ~300ms That's not that bad... @miniksa on Mar 1: OK I investigated the actual buffer dimensions and parameters used by ConEmu (81 wide x 32766 tall buffer) and reading 99 rows at a time worth of attribute data. The new metrics for the closer matching test are: v1 = 20-50ms v2 = 130-170ms @miniksa on Mar 1: I made one for FillConsoleOutputAttribute too. Same dimensions. v1 is 20-40ms v2 is 120msish @miniksa on Mar 1: Added a third and final test for ReadConsoleOutputW and it seems to just straight up match the v1 perf.
Author
Owner

@lhecker commented on GitHub (Oct 10, 2024):

With the ConsoleBench project we now have a way to track the performance in a more controlled and visual way. I'll be closing this issue then.

@lhecker commented on GitHub (Oct 10, 2024): With the ConsoleBench project we now have a way to track the performance in a more controlled and visual way. I'll be closing this issue then.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1073