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

Performance issue due to usage of Powershell #84

Closed
paulstelian97 opened this issue Jul 17, 2019 · 6 comments
Closed

Performance issue due to usage of Powershell #84

paulstelian97 opened this issue Jul 17, 2019 · 6 comments
Labels
Enhancement This is either an issue that describes ehcmnt./feature or a PR that introduces ehcmnt./feature Status: Patched This is fixed and is part of a released version. Target: 2.x This is targeted to the 2.x release.
Projects

Comments

@paulstelian97
Copy link

Background Information:

  • Build: 18362 (19h1_release)
  • WSL: Ubuntu 18.04.2 LTS (Ubuntu in Store)
  • Version: wslu 2.0.0, wslfetch v38

Describe the bug
wslfetch takes a long time to display output (I've seen it vary between 7 and 15 seconds). wslsys takes 1.5-3 seconds itself.

To Reproduce
Steps to reproduce the behavior: Just run wslfetch with no parameters (same for wslsys)

Expected behavior
The output should appear more quickly.

Additional context
I initially suspected that it was Powershell being slow but I can't seem to get it to show in my task manager so I may be wrong. You don't call it THAT many times do you?

I will also investigate on a solution myself.

@paulstelian97
Copy link
Author

I've put in some prints between the lines in wslsys and apparently the lines that run Powershell take a full half-second to run. I will try to devise ways to call cmd.exe instead (and reg query commands) to make it faster. If I succeed, I'll bring up a pull request.

@patrick330602
Copy link
Member

I believe this is the existing problem for wslfetch, as it doesn't cache information as neofetch or screenfetch. the performance using powershell.exe and reg.exe is actually pretty similar.

@paulstelian97
Copy link
Author

So it means that it's something specific to my system that the performance with powershell.exe is much worse? Considering the same number of calls to a Windows executable (either powershell or reg) from my patch it definitely makes a difference on my system. Does it not on yours?

@patrick330602
Copy link
Member

Interesting. I will do another test on virtual machine just for that. I don't want to get into "It works on my machine" situation.

@paulstelian97
Copy link
Author

Do try to limit CPU performance (my old laptop had i3-5005u and it took even more than that half-second for Powershell to launch, my current personal laptop has an i5-8250u and still takes that half-second to launch, my work laptop has some i7 [HQ category] and Powershell starts before the window launch animation ends).

@patrick330602 patrick330602 added Enhancement This is either an issue that describes ehcmnt./feature or a PR that introduces ehcmnt./feature Status: In Progress This is being worked on and not ready. Target: 2.x This is targeted to the 2.x release. labels Jul 28, 2019
@patrick330602
Copy link
Member

You are right, on a computer that is not that powerful, the two commands showed a huge speed difference. there's still a little bit things to modify in your PR

@patrick330602 patrick330602 added Status: Pending Release This is fixed but not yet released. and removed Status: In Progress This is being worked on and not ready. labels Jul 28, 2019
@patrick330602 patrick330602 added this to Done in 2.x Project Jul 29, 2019
@patrick330602 patrick330602 added Status: Patched This is fixed and is part of a released version. and removed Status: Pending Release This is fixed but not yet released. labels Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is either an issue that describes ehcmnt./feature or a PR that introduces ehcmnt./feature Status: Patched This is fixed and is part of a released version. Target: 2.x This is targeted to the 2.x release.
Projects
No open projects
2.x Project
  
Done
Development

No branches or pull requests

2 participants