winfetch icon indicating copy to clipboard operation
winfetch copied to clipboard

Speed Up info_gpu

Open Carterpersall opened this issue 3 years ago • 10 comments

  • Optimized GPU fetching
    • Instead of using Get-CimInstance to get GPU information, which can be very slow, gets the registry entries at 'HKLM:\SOFTWARE\Microsoft\DirectX', which contains a list of video adapters
    • 1690 ms -> 40.16 ms
      • 42x faster (nice)

TODO:

  • [x] Fix edge case for users with multiple of the same GPU
  • [x] Create case for when LastSeen key doesn't exist
    • Note to Self: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Enum\PCI contains currently connected GPU's hardware IDs
      • Could use as alternative to LastSeen key
      • HKEY_CURRENT_CONFIG\System\CurrentControlSet\Enum\PCI has same keys
    • Another Note to Self: Using HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4d36e968-e325-11ce-bfc1-08002be10318}\ could be easier and faster than current method

Carterpersall avatar Sep 13 '22 15:09 Carterpersall