Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.55k stars 571 forks source link

Slow perfomance if Aero desktop theme is used #2345

Open Migel1 opened 3 years ago

Migel1 commented 3 years ago

Versions

ConEmu build: 210718 x64 (and probably older versions) OS version: Windows 7 SP1 x64 Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): Far, cmd

Problem description

If Windows 7 simplified desktop theme is turned in response time of programs running in Conemu in near the same as response time of these programs running in plain console window. But if the default Windows 7 Aero theme is turned on then response time of programs running in Conemu becomes noticeably slower comparing to plain console window - there is a noticable delay between keypress and screen redraw.

Probably the delay depends on Conemu window size - if window size is 80*25 characters then the redraw speed is fast, but after resizing window to a larger size the delay become slower and slower and for the 200*50 window size the delay is so big that comfortable work with Conemu is not possible. But after switching to simplified desktop theme the delay immediately become much smaller (without restarting Conemu), and working in the same window (200*50) in Conemu is comfortable again.

The CPU is rather old, but is able to decode 1080p video. Also there are no such problems with other software - windows in other programs redraw fast independent of selected Windows desktop theme.

Steps to reproduce

  1. Choose Windows 7 Aero desktop theme.
  2. Run Far in Conemu and select large window size (200*50, for example).
  3. See that cursor in Far moves with noticeable delay.
  4. Choose Windows 7 simplified desktop theme.
  5. Now cursor in the same Far window moves without delays.

Actual results

Speed of Conemu window redraw is slow if Aero desktop theme is used.

Expected results

Speed of Conemu window shouldn't depend on selected Windows desktop theme.

Maximus5 commented 3 years ago

What's about your transparency settings?

Migel1 commented 3 years ago

What's about your transparency settings?

When Windows 7 Aero theme is used transparency of window decorations is enabled. When Windows 7 simplified theme is used transparency of window decorations is disabled.

Conemu is used with default settings (no transparent items in Conemu window client area regardless of Windows theme).

UPD: Also I tried to turn transparency off while Aero theme is active - and perfomance is still low.

Migel1 commented 3 years ago

I tried to play with SystemPropertiesPerformance.exe and found out that the key reason for slowdown is the "Enable desktop composition" setting. If this setting is off the performance is good even with the Aero theme, but when it is turned on the perfomance become slow. Also I found out that Conemu may perform fast for some time just after enabling this setting, but perfomance become slow after some actions such as minimizing and restoring Conemu window, restarting it, switching for some time to other programs and so on.

So the updated list of steps to reproduce the problem is:

  1. Choose Windows 7 Aero desktop theme.
  2. Run Far in Conemu and select large window size (200*50, for example).
  3. See that cursor in Far moves with noticeable delays.
  4. Run SystemPropertiesPerformance.exe and disable the "Enable desktop composition" setting.
  5. Now cursor in the same Far window moves without delays.
  6. Run SystemPropertiesPerformance.exe and enable the "Enable desktop composition" setting back.
  7. Immediately after this the cursor in the Far window may still move without delays.
  8. Perform some action with the Conemu window such as minimizing and restoring it or switching for some time to other programs.
  9. Now the cursor in Far moves with noticeable delays again.
Maximus5 commented 3 years ago

In other words the bottleneck is WinAPI. I would say ConEmu could not improve here anything

Migel1 commented 3 years ago

Far opened in a real console of the same size do not have this problem - it performs equally fast regardless of the selected desktop theme. So WinAPI is certainly fast enough to redraw such windows without delays.

Also there are no redraw speed problems not only in real console, but also in other software such as office applications, browsers and so on. Only Conemu has this problem.

It seems that there is a bootleneck somewhere in Conemu redraw routine which manifests under certain conbination of conditions: 1, Relatively slow CPU.

  1. Big window size.
  2. Desktop composition enabled.
  3. Some previous interaction with Conemu and other windows.
Maximus5 commented 3 years ago

Could you show the screenshot of the Settings/Info page? I'm interested in performance counters when you observe the lags.

Migel1 commented 3 years ago

Reproduced the issue in a clean user profile and found out more presize conditions to reproduce it (with screenshots of statistics):

  1. Choose Windows 7 Aero desktop theme.
  2. Run Far in Conemu and select large window size (200*50, for example).
  3. See that cursor in Far moves without delays (dc_nofirefox.png).
  4. Run Firefox and open a site (for example, yandex.ru).
  5. Cursor in Far still moves without delays.
  6. Minimize and maximize Conemu window.
  7. Now cursor in the Far moves with delays (dc_firefox.png).
  8. Close Firefox.
  9. Cursor in the Far still moves with delays.
  10. Minimize and maximize Conemu window.
  11. Now cursor in the Far moves without delays again.

Far running in a plain console window has no perfomance problems during this test.

Also tested these steps with desktop composition disabled - there is no significant perfomance slowdown in this case (nodc_nofirefox.png and nodc_firefox.png).

And if these steps are performed with Chrome instead of Firefox there is no significant perfomance slowdown too.

Migel1 commented 1 year ago

Got an update on the situation. It seems that the issue was a result of hardware problems. The motherboard recently died and after replacing it by a similar one the problem is gone. (OS, drivers and video card remained the same.)

Thus I closing this issue.