stax76
9th March 2022, 19:36
To answer my own question, I made some performance tests to find out how fast a test app or script can start, print Hello World and terminate.
These are my numbers:
C: 10 ms
C++: 10 ms
Rust: 10 ms
Python: 30 ms
.NET Framework: 30 ms
.NET Core: 40 ms
Lua 5.1: 13 ms
Lua 5.4: 13 ms
PowerShell 5.1: 230 ms
PowerShell 7.2: 400 ms
GO: 15 ms
How it was measured:
using System.Diagnostics;
int count = 0;
Stopwatch w = new Stopwatch();
w.Start();
for (int i = 0; i < 100; i++)
{
count++;
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = @"D:\Projects\test\test.exe";
p.Start();
p.WaitForExit();
p.Dispose();
}
w.Stop();
Console.WriteLine(w.ElapsedMilliseconds / count);
Console.ReadKey();
I was surprised by some of these numbers, positive and negative.
Maybe somebody of you find this topic also interesting. Most of the time it's not that important, I admit, but sometimes it can be! That's why I wanted to know exactly. I certainly use some apps I wish would start faster, for instance Anki and JDownloader, and I had a PS script to paste the date that was way too slow. It was launched with Flow Launcher using my Favorites plugin and my run-hidden app to hide the console window.
These are my numbers:
C: 10 ms
C++: 10 ms
Rust: 10 ms
Python: 30 ms
.NET Framework: 30 ms
.NET Core: 40 ms
Lua 5.1: 13 ms
Lua 5.4: 13 ms
PowerShell 5.1: 230 ms
PowerShell 7.2: 400 ms
GO: 15 ms
How it was measured:
using System.Diagnostics;
int count = 0;
Stopwatch w = new Stopwatch();
w.Start();
for (int i = 0; i < 100; i++)
{
count++;
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = @"D:\Projects\test\test.exe";
p.Start();
p.WaitForExit();
p.Dispose();
}
w.Stop();
Console.WriteLine(w.ElapsedMilliseconds / count);
Console.ReadKey();
I was surprised by some of these numbers, positive and negative.
Maybe somebody of you find this topic also interesting. Most of the time it's not that important, I admit, but sometimes it can be! That's why I wanted to know exactly. I certainly use some apps I wish would start faster, for instance Anki and JDownloader, and I had a PS script to paste the date that was way too slow. It was launched with Flow Launcher using my Favorites plugin and my run-hidden app to hide the console window.