-
Notifications
You must be signed in to change notification settings - Fork 90
Optimizations #151
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
Optimizations #151
Conversation
- Instead of using Get-CimInstance to get GPU information, which can be very slow, gets the registry entry at HKLM:\SOFTWARE\Microsoft\DirectX\ which contains a list of installed video adapters
- 1690 ms -> 40.16 ms
- 42x faster (nice)
|
@HO-COOH does this work as before with your setup (multiple GPUs)? |
- Added a check where the LastSeen value of HKLM:\SOFTWARE\Microsoft\DirectX\ is compared to the LastSeen value of each subkey
|
@jcwillox might be fixed in the most recent commit, can you check? The LastSeen implementation should be reliable as the base DirectX key has a LastSeen value which can be compared with it's subkeys to see which were detected in its most recent run-through. This might also allow me to fix an edge case where if someone has two of the same GPU, it would be detected as a duplicate entry and not be shown. |
Works on my laptop with its integrated and dedicated graphics: |
- Made info_locale speedy
- Takes the registy entries at HKCU:Control Panel\International to get region code and language code, and passes them into two very large hash tables to get the accompanying region and language values.
- TODO: Make work when user has more than one language
- Maybe: Find a way to circumvent the very large table
- 3251 ms -> 12.43 ms
- 262x Faster
I tested it and it, unfortunately, returns no GPUs as the |
| "161832257" = "Latin America and the Caribbean" | ||
| "161832258" = "Bonaire, Sint Eustatius and Saba" | ||
| } | ||
| $languageLookup = @{ |
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 does not cover all languages (English (India) in my case)
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.
It seems that the languageLookup array wasn't complete. I'll fix that in my next commit.
|
Also, it would be better to split out optimizations for different functions in different PRs. |



The intent of this pull request is to speed up winfetch wherever I can
Done:
TODO: