PowerShell is slow
I was going to start the new year with a positive note, but then I thought, lets get a PS1 pet hate out of the way first.
PowerShell is slow.
There are many ways to demonstrate this, but for this case I’m going to use a small snippet of code I found to render the mandelbrot set to the console window. It’s not my code and don’t know where it came from, but algorithm is fairly well known.
The code to demonstrate this is in a zip file here.
If you run
./mandel2.ps1 you get this pretty picture.
There is a Windows Scripting Host version. Run this with
There is a JScript.NET version. Compile it with JSC and or run the supplied one with
Now on my machine (a 2.66ghz quad core MacPro running XP in Parallels Desktop), I get these results:
|Windows Scripting Host||90 ms|
|HTML (IE7)||110 ms|
|HTML (Firefox 2)||140 ms|
|HTML (Safari on OSX)||103 ms|
It’s more than an order of magnitude slower than Microsoft’s previous attempt at a scripting environment!
This tardiness really shows itself in other inappropriate projects I’m working on in PS1. I really hope the PowerShell team at Microsoft address this for version 1.1 – maybe they should go speak to the jscript team.