3 ms·
I use Powershell in Windows and am a big fan. It is a biiiiiiiiiiiiiiiiiiiig download on Linux, making it pretty impractical managing many different Linux machi
by lordgroff 6y ago
I use Powershell in Windows and am a big fan. It is a biiiiiiiiiiiiiiiiiiiig download on Linux, making it pretty impractical managing many different Linux machines.
- majkinetor 6y ago> It is a biiiiiiiiiiiiiiiiiiiig download How big really? Can't be more then 200MB? Should be less then minute to download and install? If you have docker, can you go that route? Also, if you account the fact that you have variants of many other popular tools included OTB is that really a downside ? That is certainly different concern, you want fast and practical script programming and why would you care if it has first time latency of couple of minutes if you are set good forever after that ?
- scaladev 6y agoI just checked, if you already have .NET installed, the powershell package is about 20 MBs, which is… tolerable. However, I see that the latest version still starts very slowly compared to *nix shells (and also Python). The shell was running from tmpfs (so basically a RAM disk). I have a decent processor and an NVMe SSD, and this is what I see (it was tested 10 times in a row to pull everything into the page cache properly, and the numbers are pretty stable): $ time ./pwsh <<<"" >/dev/null real 0m1.050s user 0m1.464s sys 0m0.067s More than a second to execute an empty 'script', and even longer to get to the interactive prompt (which is harder to time properly so I'm not publishing any numbers). It's even slower on an older Windows laptop which I have lying around (starts in about 3-4 seconds). Absolutely terrible for an interactive shell/script execution engine. Just for comparison's sake, the same laptop can run an empty bash script in 2-3 milliseconds. This is very important when running build jobs, for example.
- majkinetor 6y agoHow about pwsh -NoLogo -NoProfile ? > Measure-Command { pwsh -NoProfile -NoLogo exit } Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 254 BTW, Windows OS is often subject of Windows Defender and other AVs which are not present on Linux machines and their slowdown of the system is phenomenal.
- scaladev 6y agoThanks for the suggestion. Adding these flags halves the startup time: $ time ./pwsh -NoProfile -NoLogo <<<'' >/dev/null real 0m0.456s user 0m0.388s sys 0m0.040s Much better, but I still wouldn't use this even as an interactive shell, as I open a few hundred terminal windows each day. There's no defender (or anything similar) on that other machine. It also has an SSD. With an older HDD powershell started in about 10-15 seconds there (while cold startup time for bash was something like a second, and instantly afterwards).
- majkinetor 6y agoI open few hundred terminals each day. There is something seriously wrong with your machines. Pwsh is not a king of speed but 10-15 is local problem. Anything more then 2 seconds is a local problem. You can maybe get to 5 with lots of modules in your profile.