ps1.soapyfrog.com

doing inappropriate things with powershell

Pages

  • About
  • Downloads
  • Archives

Search

Popular Posts

  • Grrr 1.1 and Big Invaders
  • Space Invaders
  • Convert images to text (ASCII art)
  • Cmdlet clashes
  • Console screen grabs in html

Recent Posts

  • Grrr source code, including Invaders
  • Google going down the pan
  • Cmdlet clashes
  • Grrr 1.1 and Big Invaders
  • Grrr, Cmdlets and PSInvaders revival

Categories

  • Announce (7)
  • Cmdlets (2)
  • Cool (16)
  • Grrr (6)
  • Hint (2)
  • Invaders (5)
  • Odd (2)
  • PowerShell (27)
  • Quiz (3)
  • Rant (7)
  • Uncategorized (1)
  • Utility (5)

Months

  • August 2007 (1)
  • April 2007 (1)
  • March 2007 (1)
  • February 2007 (3)
  • January 2007 (25)
  • December 2006 (1)

Bookmarks

  • Blogroll
    • $script Fanatics
    • blog.soapyfrog.com
    • Brian Long
    • Lee Holmes
    • Nik Crabtree
    • PowerShell-Scripting (French)
    • Richy Rich
    • The PowerShell Guy
    • Windows PowerShell
  • Links
    • Carbon-neutral web hosting!

Meta

  • Log in
  • Posts RSS
  • Comments RSS
  • Valid XHTML
  • Valid CSS
« Happy New Year
PNG and Internet Explorer »
 

PowerShell is slow

01 Jan 2007 08:44 am// PowerShell, Rant    

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 cscript mandel2.wsf.

There is a JScript.NET version. Compile it with JSC and or run the supplied one with ./mandel2.js.exe.

There is even a javascript-embedded-in-a-HTML-page version, just click on mandel2.html.

Now on my machine (a 2.66ghz quad core MacPro running XP in Parallels Desktop), I get these results:

PowerShell 1510 ms
Windows Scripting Host 90 ms
JScript.NET 160 ms
HTML (IE7) 110 ms
HTML (Firefox 2) 140 ms
HTML (Safari on OSX) 103 ms

OK, so the existing javascript engine in Windows (used by IE and WSF) are pretty good at this. Safari’s is pretty good (using KJS). So why is this brand spanking new language, PowerShell, so very poor?

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.

Comments are closed.

Copyright © 2006-2008 Adrian Milliner

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.