· projects · 3 min read

Windows ScreenFetch Fast

Windows-screenFetch but faster

Windows-screenFetch but faster

What is this?

screenFetch was originally made as a “Bash Screenshot Information Tool”. Simply, it lets you display detailed information about your system in the terminal, it also comes with a ASCII logo for the detected Linux distribution. This doesn’t work on Windows natively and this project is my attempt to provide a solution that does not require obtaining a linux environment on windows.

TL;DR: Windows-screenFetch brings screenFetch to Windows, my project is a fork that aims to make it faster, so that it can be used as a splash screen.

How much faster is it?

11x faster (in my testing). Around 2 seconds to 0.2 seconds.

2035.9979ms to 177.4912ms

NOTE: The following statistics exclude “Get-” from the function names for readability






Testing Methodology

  • Use the function speed tests provided in the fork.

  • Run speed test 5-10 times before taking the real tests so the script stabilizes.

  • Take 10 real tests and record the results (I use Excel).

  • Group the results, calculate the averages, and sort the functions based on average speed.

Possible Downfalls

  • The test uses Measure-Command, better alternatives could exist.

    • I assume that Microsoft knows how to make a decent time measuring utility.
  • Sample size could be possibly be too small.

    • The deviations are pretty minimal
  • While 5-10 initial tests are performed and discarded for the scripts to stabilize, some kind of caching could be going on that skews the results.

    • I assume that since both versions go through this process, there is minimal error.

How was the speed improved?


The original doesn’t really filter properties, which increases memory usage and slows down the script.

For example, this is the entire original Get-CPU function:

Function Get-CPU()
    return (((Get-CimInstance Win32_Processor).Name) -replace '\s+', ' ');

If you look at the speed test results above, you can see that this Get-CimInstance call is responsible for the function taking 1043.99ms. That is an entire second, and makes up half of the total execution time.

Meanwhile, here is the new one:

Function Get-CPU()
    return (Get-CimInstance CIM_Processor -Property Name).Name;

This improved version takes 7.64ms, that is 137x faster.

DRY (Don’t-Repeat-Yourself)

Turns out the original calls Get-CimInstance every time Win32_OperatingSystem or something else is needed, which can be a very expensive call. My version calls the commonly used instances once and then stores them in a variable.

For example, this original function takes 149.64ms:

Function Get-OS()
    return (Get-CimInstance Win32_OperatingSystem).Caption + " " +
        (Get-CimInstance Win32_OperatingSystem).OSArchitecture;

Meanwhile, the new one takes 0.73ms (205x faster):

$osx = Get-CimInstance Win32_OperatingSystem

# ...

Function Get-OS()
    return $osx.Caption + " " +

Those are the main ones, here is the commit that added all of the speed improvements.

Where can I get it?

Here is the GitHub page. Alternatively, install it through Powershell Gallery:

Install-Module -Name windows-screenfetch-fast

If you’re having errors, here is a solution:

“If you have followed the installation steps but you’re getting the following error:

> The file C:\<yourpath>\screenfetch.ps1 is not digitally signed.
> The script will not execute on the system.

A common fix is to run the powershell command Set-ExecutionPolicy Unrestricted in a shell with administrative privileges.” - Here is the original :).

Back to Blog

Related Posts

View All Posts »

PC Specs

Cross platform desktop app that displays your computer specs

CAO Calculator

Android app that helps calculate how many CAO points you need to qualify for a course.