Skip to content
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

cmd execution and GCC compilation scripts slow #368

Open
kjarvel opened this issue Feb 6, 2019 · 7 comments
Open

cmd execution and GCC compilation scripts slow #368

kjarvel opened this issue Feb 6, 2019 · 7 comments
Labels
Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Conhost For issues in the Console codebase
Milestone

Comments

@kjarvel
Copy link

kjarvel commented Feb 6, 2019

Configuration

Windows build number:

  • Windows 7 SP1: Microsoft Windows [Version 6.1.7601]
  • Windows 10 1809: Microsoft Windows [Version 10.0.17763.253]

What you're doing and what's happening:

With Windows 7, executing build_gcc.bat (1000 x gcc-arm-none-eabi) in Command Prompt takes 0:46.
With Windows 10, the same script takes +78% longer time with default settings (01:22).

With Windows 7, executing build_cmd.bat (1000 x cmd.exe x 20) in Command Prompt takes 01:48.
With Windows 10, the same script takes +139% longer time with default settings (04:18).

Some observations:
With Windows 10, some computers show heavy (25-40%) GPU load when Command Prompt is scrolling.
A Windows 7 Virtual Machine running build_cmd.bat in Virtual Box on a Windows 10 host outperforms the Windows 10 host.

The strange thing is that starting Command Prompt with "Run as Administrator" on Windows 10 increases performance a lot - back to Windows 7 level. Using the "Legacy Console mode" checkbox only seems to have a minor effect.

See attached scripts and results.txt.
scripts.zip
results.txt

What's wrong / what should be happening instead:

Windows 10 Command Prompt performance for build_cmd.bat and build_gcc.batshould be the same as with Windows 7, or at least the same as Windows 10 Command Prompt running as Administrator.

(The problem is that running a 10 minute build script might take 20+ minutes on Windows 10)

@miniksa miniksa added Product-Conhost For issues in the Console codebase Area-Performance Performance-related issue labels Mar 4, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 18, 2019
@kjarvel
Copy link
Author

kjarvel commented Jun 9, 2020

Update one year later:

  • CPU: Intel Core i5-4590 @ 3.30 GHz
  • Windows 7 SP1: Microsoft Windows [Version 6.1.7601]
  • Windows 10 1909: Microsoft Windows [Version 10.0.18363.836]

build_cmd.bat

  • Windows 7, Command Prompt = 01:34
  • Windows 10, Command Prompt = 02:47
  • Windows 10, Windows Terminal Version 1.0.1401.0 = 02:36

@LuanVSO
Copy link
Contributor

LuanVSO commented Aug 31, 2020

did you try disabling windows defender real time protection to measure the performance?

@kjarvel
Copy link
Author

kjarvel commented Aug 31, 2020

did you try disabling windows defender real time protection to measure the performance?

Yes, see the column named "Anti-virus" in results.txt.

@iamsergio
Copy link

Is this specific to gcc or also observable with MSVC ?

@kjarvel
Copy link
Author

kjarvel commented Nov 28, 2020

Is this specific to gcc or also observable with MSVC ?

See build_cmd.bat and the results for build_cmd.bat in results.txt. It does not use gcc.

@zadjii-msft
Copy link
Member

You know, this is weird. I'd be fairly sure that checking the "use legacy console" checkbox would remove the issue, if it was something in the Console v2 codebase. That's pretty literally the exact code from the Windows 7 build, with only minor modifications to get it loaded into the v2 console.

We've been making pretty constant perf improvements over the years (case in point: #1064 (comment)). At this point, the Terminal is generally faster than the Console at all.

If you're still seeing this, would you mind trying to trace your build (or at least part of it) with WPA? I think we'd all be curious to see what the hot paths are.

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 22, 2021
@kjarvel
Copy link
Author

kjarvel commented Nov 22, 2021

Thanks for the response.
Yes, I'm also guessing that it does not have to do with the Console itself, but some underlying limitation.
I once again tried the original bat file 'build_cmd.bat' that is attached in 'scripts.zip' - on a brand new computer.

You can easily try this yourself, it requires no external dependencies, and you will see the same results.
Since you can also try this bat file within 3 minutes (1 minute on Win7) I ask you to trace it with WPA, because I don't know what that is, or how to use it.

My results now in 2021, performed on the same computer:

  • Windows 11: ~3 minutes to complete build_cmd.bat
  • Windows 7: ~1:30 to complete build_cmd.bat

Conclusion: Windows 7 runs the script twice as fast, even when running in a Virtual machine, on the same computer.

See attached video. Windows 7 to the left. Windows 11 to the right:
win7_vs_win11_2021.zip

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 22, 2021
@zadjii-msft zadjii-msft added this to the 22H1 milestone Jan 10, 2022
@zadjii-msft zadjii-msft added Priority-1 A description (P1) and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jan 10, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H1, Terminal v1.14 Feb 2, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v1.14, 22H1 Mar 10, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H1, 22H2 Aug 3, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H2, Backlog Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

5 participants